@oslokommune/punkt-elements 16.7.1 → 16.7.4

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 (286) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/accordion-BB1JrONI.cjs +34 -0
  3. package/dist/accordion-nNH87Y60.js +130 -0
  4. package/dist/alert-BEEnTiCb.cjs +33 -0
  5. package/dist/alert-ePJuDtmm.js +171 -0
  6. package/dist/async-directive-B9P1Qa0k.cjs +1 -0
  7. package/dist/async-directive-CaQiqjyV.js +55 -0
  8. package/dist/backlink-Ba03LlbB.cjs +13 -0
  9. package/dist/backlink-CiwXrQYD.js +38 -0
  10. package/dist/booleanish-BmcOU-43.js +11 -0
  11. package/dist/booleanish-jJLlnr6-.cjs +1 -0
  12. package/dist/breadcrumbs-CD1zib3s.cjs +43 -0
  13. package/dist/breadcrumbs-CpuVqWhF.js +76 -0
  14. package/dist/button-BIpd1xJh.js +95 -0
  15. package/dist/button-D-TOBaJB.cjs +27 -0
  16. package/dist/calendar-BzEtOJla.js +2031 -0
  17. package/dist/calendar-E5jJLt8D.cjs +90 -0
  18. package/dist/card-BYJu1MYm.js +339 -0
  19. package/dist/card-CUFhMVim.cjs +87 -0
  20. package/dist/checkbox-BARDb9iV.cjs +31 -0
  21. package/dist/checkbox-Cspxcvt_.js +111 -0
  22. package/dist/class-map-C8HuhNzZ.js +27 -0
  23. package/dist/class-map-CJ-msbHs.cjs +1 -0
  24. package/dist/classutils-DEL164Ur.js +7 -0
  25. package/dist/classutils-z8YsPlOf.cjs +1 -0
  26. package/dist/combobox-BcdLZRDU.js +984 -0
  27. package/dist/combobox-CGbFTWq_.cjs +135 -0
  28. package/dist/consent-DeB_5sWH.js +197 -0
  29. package/dist/consent-hwu7pp3S.cjs +11 -0
  30. package/dist/datepicker-DpmlsnH_.cjs +273 -0
  31. package/dist/datepicker-OVd8pmnZ.js +1125 -0
  32. package/dist/dialog-polyfill.esm-1hPr0gl9.js +280 -0
  33. package/dist/dialog-polyfill.esm-D3Oinvk0.cjs +1 -0
  34. package/dist/directive-3THFsVew.js +28 -0
  35. package/dist/directive-CJ2giQBZ.cjs +1 -0
  36. package/dist/directive-helpers-D1QSxY17.cjs +1 -0
  37. package/dist/directive-helpers-Dkv2gKgs.js +25 -0
  38. package/dist/element-DjtxO-1r.cjs +2 -0
  39. package/dist/element-cZ85T_aa.js +693 -0
  40. package/dist/element-with-slot-4J2o3SeU.js +166 -0
  41. package/dist/element-with-slot-CWoTGA1B.cjs +1 -0
  42. package/dist/header-DWgPgGfS.cjs +304 -0
  43. package/dist/header-a6ztVNp3.js +782 -0
  44. package/dist/heading-BgSWIRii.cjs +1 -0
  45. package/dist/heading-DiQLPxdf.js +73 -0
  46. package/dist/helptext-CCBKKLus.js +65 -0
  47. package/dist/helptext-D-3QfZv5.cjs +24 -0
  48. package/dist/icon-Co72KtgF.js +86 -0
  49. package/dist/icon-Dr8sfT2X.cjs +1 -0
  50. package/dist/if-defined-Cjj8qN-Z.js +5 -0
  51. package/dist/if-defined-XKOD_t_V.cjs +1 -0
  52. package/dist/index.d.ts +1 -2
  53. package/dist/input-element-B1yxcfz4.cjs +1 -0
  54. package/dist/input-element-Bw1s6NlF.js +643 -0
  55. package/dist/input-wrapper-BRuVELpK.cjs +54 -0
  56. package/dist/input-wrapper-CDyHTR1V.js +164 -0
  57. package/dist/input-wrapper-Dwd-_sKm.cjs +1 -0
  58. package/dist/input-wrapper-YfTmpSSY.js +117 -0
  59. package/dist/link-CKAFMz9j.js +89 -0
  60. package/dist/link-CyTCpI0k.cjs +7 -0
  61. package/dist/linkcard-B0KOGaGj.js +55 -0
  62. package/dist/linkcard-BE4-FewK.cjs +13 -0
  63. package/dist/listbox-DCA2JoPV.cjs +106 -0
  64. package/dist/listbox-DuBgTFvH.js +397 -0
  65. package/dist/loader-6kFZUErT.js +66 -0
  66. package/dist/loader-CX2rsC01.cjs +16 -0
  67. package/dist/messagebox-Cwlg5sOr.js +110 -0
  68. package/dist/messagebox-Din9X53b.cjs +13 -0
  69. package/dist/modal-C_wtsh9m.js +209 -0
  70. package/dist/modal-DS_wUOIv.cjs +36 -0
  71. package/dist/pkt-accordion.cjs +1 -1
  72. package/dist/pkt-accordion.js +2 -7
  73. package/dist/pkt-alert.cjs +1 -1
  74. package/dist/pkt-alert.js +2 -6
  75. package/dist/pkt-backlink.cjs +1 -1
  76. package/dist/pkt-backlink.js +2 -6
  77. package/dist/pkt-breadcrumbs.cjs +1 -43
  78. package/dist/pkt-breadcrumbs.js +2 -79
  79. package/dist/pkt-button.cjs +1 -1
  80. package/dist/pkt-button.js +2 -6
  81. package/dist/pkt-calendar.cjs +1 -1
  82. package/dist/pkt-calendar.js +2 -6
  83. package/dist/pkt-card.cjs +1 -1
  84. package/dist/pkt-card.js +2 -6
  85. package/dist/pkt-checkbox.cjs +1 -1
  86. package/dist/pkt-checkbox.js +2 -6
  87. package/dist/pkt-combobox.cjs +1 -1
  88. package/dist/pkt-combobox.js +2 -6
  89. package/dist/pkt-consent.cjs +1 -1
  90. package/dist/pkt-consent.js +2 -6
  91. package/dist/pkt-datepicker.cjs +1 -1
  92. package/dist/pkt-datepicker.js +5 -10
  93. package/dist/pkt-header.cjs +1 -304
  94. package/dist/pkt-header.js +2 -855
  95. package/dist/pkt-heading.cjs +1 -1
  96. package/dist/pkt-heading.js +2 -6
  97. package/dist/pkt-helptext.cjs +1 -1
  98. package/dist/pkt-helptext.js +2 -6
  99. package/dist/pkt-icon.cjs +1 -1
  100. package/dist/pkt-icon.js +2 -6
  101. package/dist/pkt-index.cjs +1 -1
  102. package/dist/pkt-index.js +30 -66
  103. package/dist/pkt-input-wrapper.cjs +1 -1
  104. package/dist/pkt-input-wrapper.js +2 -6
  105. package/dist/pkt-link.cjs +1 -1
  106. package/dist/pkt-link.js +2 -6
  107. package/dist/pkt-linkcard.cjs +1 -1
  108. package/dist/pkt-linkcard.js +2 -6
  109. package/dist/pkt-listbox.cjs +1 -1
  110. package/dist/pkt-listbox.js +2 -6
  111. package/dist/pkt-loader.cjs +1 -1
  112. package/dist/pkt-loader.js +2 -6
  113. package/dist/pkt-messagebox.cjs +1 -1
  114. package/dist/pkt-messagebox.js +2 -6
  115. package/dist/pkt-modal.cjs +1 -1
  116. package/dist/pkt-modal.js +2 -6
  117. package/dist/pkt-options-controller-CRrI6WMk.js +43 -0
  118. package/dist/pkt-options-controller-CXUGx134.cjs +1 -0
  119. package/dist/pkt-progressbar.cjs +1 -1
  120. package/dist/pkt-progressbar.js +2 -6
  121. package/dist/pkt-radiobutton.cjs +1 -1
  122. package/dist/pkt-radiobutton.js +2 -6
  123. package/dist/pkt-select.cjs +1 -1
  124. package/dist/pkt-select.js +2 -6
  125. package/dist/pkt-tabs.cjs +1 -1
  126. package/dist/pkt-tabs.js +2 -7
  127. package/dist/pkt-tag.cjs +1 -1
  128. package/dist/pkt-tag.js +2 -6
  129. package/dist/pkt-textarea.cjs +1 -1
  130. package/dist/pkt-textarea.js +2 -6
  131. package/dist/pkt-textinput.cjs +1 -1
  132. package/dist/pkt-textinput.js +2 -6
  133. package/dist/pkt-timepicker.cjs +1 -191
  134. package/dist/pkt-timepicker.js +2 -558
  135. package/dist/progressbar-CdXtmOBb.cjs +17 -0
  136. package/dist/progressbar-Dy9AiYQz.js +113 -0
  137. package/dist/radiobutton-GOnpUbCW.cjs +31 -0
  138. package/dist/radiobutton-V_KPbup_.js +84 -0
  139. package/dist/ref-BaJ0mBT_.cjs +1 -0
  140. package/dist/ref-RS8Uv6uC.js +30 -0
  141. package/dist/repeat-Cepr3469.js +57 -0
  142. package/dist/repeat-CqcDYBxr.cjs +1 -0
  143. package/dist/select-BSAFd8Wa.js +164 -0
  144. package/dist/select-C2i8sOk5.cjs +49 -0
  145. package/dist/tabs-D8nL9rWx.cjs +37 -0
  146. package/dist/tabs-Y7utmJi9.js +318 -0
  147. package/dist/tag-DLthw5b4.cjs +27 -0
  148. package/dist/tag-VwykmuQR.js +179 -0
  149. package/dist/textarea-D7aGOyDf.cjs +46 -0
  150. package/dist/textarea-DYOBhJrN.js +115 -0
  151. package/dist/textinput-BUgntXnM.js +124 -0
  152. package/dist/textinput-DFh8_9cx.cjs +70 -0
  153. package/dist/timepicker-BIfE7KKJ.cjs +191 -0
  154. package/dist/timepicker-DaSwn1FA.js +503 -0
  155. package/dist/utils-CUqCKGvp.js +7 -0
  156. package/dist/utils-CjAbIttF.cjs +1 -0
  157. package/package.json +6 -6
  158. package/src/components/accordion/accordion.ts +6 -1
  159. package/src/components/accordion/accordionitem.ts +6 -1
  160. package/src/components/alert/alert.test.ts +1 -1
  161. package/src/components/alert/alert.ts +12 -7
  162. package/src/components/backlink/backlink.ts +6 -1
  163. package/src/components/breadcrumbs/breadcrumbs.ts +6 -1
  164. package/src/components/button/button.ts +6 -1
  165. package/src/components/calendar/calendar.ts +6 -1
  166. package/src/components/card/card.ts +6 -1
  167. package/src/components/checkbox/checkbox.ts +6 -1
  168. package/src/components/combobox/combobox.ts +6 -1
  169. package/src/components/consent/consent.ts +6 -1
  170. package/src/components/datepicker/date-tags.ts +6 -1
  171. package/src/components/datepicker/datepicker-multiple.ts +6 -1
  172. package/src/components/datepicker/datepicker-popup.ts +6 -1
  173. package/src/components/datepicker/datepicker-range.ts +6 -1
  174. package/src/components/datepicker/datepicker-single.ts +6 -1
  175. package/src/components/datepicker/datepicker-utils.test.ts +16 -23
  176. package/src/components/datepicker/datepicker.ts +6 -1
  177. package/src/components/header/header-service.ts +6 -1
  178. package/src/components/header/header-user-menu.ts +6 -1
  179. package/src/components/header/header.ts +6 -1
  180. package/src/components/heading/heading.ts +6 -1
  181. package/src/components/helptext/helptext.ts +6 -1
  182. package/src/components/icon/icon.ts +6 -1
  183. package/src/components/input-wrapper/input-wrapper.ts +6 -1
  184. package/src/components/link/link.ts +6 -1
  185. package/src/components/linkcard/linkcard.ts +6 -1
  186. package/src/components/listbox/listbox.ts +6 -1
  187. package/src/components/loader/loader.ts +6 -1
  188. package/src/components/messagebox/messagebox.ts +6 -1
  189. package/src/components/modal/modal.ts +6 -1
  190. package/src/components/progressbar/progressbar.ts +6 -1
  191. package/src/components/radiobutton/radiobutton.ts +6 -1
  192. package/src/components/select/select.ts +6 -1
  193. package/src/components/tabs/tabitem.ts +6 -1
  194. package/src/components/tabs/tabs.ts +6 -1
  195. package/src/components/tag/tag.ts +6 -1
  196. package/src/components/textarea/textarea.ts +6 -1
  197. package/src/components/textinput/textinput.ts +6 -1
  198. package/src/components/timepicker/timepicker.ts +6 -1
  199. package/dist/accordionitem-D1Agl1bB.cjs +0 -34
  200. package/dist/accordionitem-ZlaXvjt5.js +0 -138
  201. package/dist/alert-BuAXrnKl.js +0 -115
  202. package/dist/alert-DFkFNTxh.cjs +0 -33
  203. package/dist/async-directive-CMzWMlZ5.js +0 -65
  204. package/dist/async-directive-DoMuclel.cjs +0 -5
  205. package/dist/backlink-EiAXUUZP.cjs +0 -13
  206. package/dist/backlink-V4DAt17e.js +0 -47
  207. package/dist/booleanish-BKVonob4.cjs +0 -1
  208. package/dist/booleanish-C9R0tdXH.js +0 -11
  209. package/dist/button-DEyvt1LI.js +0 -137
  210. package/dist/button-DYv5Dg4M.cjs +0 -27
  211. package/dist/calendar-HIE9nxcc.cjs +0 -90
  212. package/dist/calendar-S63oreVW.js +0 -2138
  213. package/dist/card-CyeH6l1c.cjs +0 -87
  214. package/dist/card-DDiLfuO4.js +0 -231
  215. package/dist/checkbox-BLlwTABj.cjs +0 -31
  216. package/dist/checkbox-ejBUa5qQ.js +0 -145
  217. package/dist/class-map-CEnykyO_.js +0 -34
  218. package/dist/class-map-CsENJXf1.cjs +0 -5
  219. package/dist/classutils-BwNK82ZQ.cjs +0 -1
  220. package/dist/classutils-RQs1k6D9.js +0 -7
  221. package/dist/combobox-BmxSecfE.js +0 -818
  222. package/dist/combobox-Hb2V-fPX.cjs +0 -135
  223. package/dist/consent-iXyx5v6J.js +0 -173
  224. package/dist/consent-ruWAEVXW.cjs +0 -11
  225. package/dist/datepicker-CZl7b8Na.js +0 -1158
  226. package/dist/datepicker-D2H7U6MS.cjs +0 -273
  227. package/dist/dialog-polyfill.esm-CPKZe7AL.cjs +0 -1
  228. package/dist/dialog-polyfill.esm-CbjBMXAG.js +0 -395
  229. package/dist/directive-C7oCP5Bh.cjs +0 -5
  230. package/dist/directive-helpers-BP2WOx60.cjs +0 -5
  231. package/dist/directive-helpers-rm-28gIj.js +0 -38
  232. package/dist/directive-oAbCiebi.js +0 -27
  233. package/dist/element-CPpT3rFQ.js +0 -638
  234. package/dist/element-gR_VtSiD.cjs +0 -27
  235. package/dist/element-with-slot-Dqk6-TRR.js +0 -240
  236. package/dist/element-with-slot-ZX-up7jO.cjs +0 -1
  237. package/dist/heading-CKt7cVn7.js +0 -101
  238. package/dist/heading-Cvz8m1xL.cjs +0 -1
  239. package/dist/helptext-5Mzp65-F.cjs +0 -24
  240. package/dist/helptext-jIoWRcCF.js +0 -80
  241. package/dist/icon-BlKA8YuW.js +0 -103
  242. package/dist/icon-Bqj9oBbl.cjs +0 -9
  243. package/dist/if-defined-B0krMLad.js +0 -10
  244. package/dist/if-defined-BOW3ODSj.cjs +0 -5
  245. package/dist/input-element-8nLwuQS4.js +0 -837
  246. package/dist/input-element-DdVhUvva.cjs +0 -1
  247. package/dist/input-wrapper-B0MkQ0IZ.cjs +0 -54
  248. package/dist/input-wrapper-B2JpK016.js +0 -179
  249. package/dist/input-wrapper-CDgenrYA.js +0 -6
  250. package/dist/input-wrapper-EoSAbU-U.cjs +0 -1
  251. package/dist/link-R_lNhViF.cjs +0 -7
  252. package/dist/link-Z_GizclR.js +0 -53
  253. package/dist/linkcard-BlQvdB1a.js +0 -54
  254. package/dist/linkcard-C7HbSLlX.cjs +0 -13
  255. package/dist/listbox-BQKDZvZn.js +0 -438
  256. package/dist/listbox-CGgV9MAe.cjs +0 -106
  257. package/dist/loader-Ci3CHU8k.js +0 -93
  258. package/dist/loader-e2gs_1xz.cjs +0 -16
  259. package/dist/messagebox-Bf-XMlvW.js +0 -69
  260. package/dist/messagebox-D67w71VX.cjs +0 -13
  261. package/dist/modal-CyvEkbfQ.cjs +0 -36
  262. package/dist/modal-DzGe1g8Z.js +0 -154
  263. package/dist/pkt-options-controller-5LXbEzuk.cjs +0 -1
  264. package/dist/pkt-options-controller-B5YalfCb.js +0 -39
  265. package/dist/progressbar-By7e0lEI.js +0 -162
  266. package/dist/progressbar-DsJ2B9Vm.cjs +0 -21
  267. package/dist/radiobutton-6frNG9J_.js +0 -111
  268. package/dist/radiobutton-Bv-BZ1Hw.cjs +0 -31
  269. package/dist/ref-Bg_Swj5w.js +0 -42
  270. package/dist/ref-CL-Xk9Xm.cjs +0 -5
  271. package/dist/repeat-BD8TKgJb.js +0 -61
  272. package/dist/repeat-Cfq8CDlf.cjs +0 -5
  273. package/dist/select-CXZt1nHS.js +0 -228
  274. package/dist/select-WFhS4Vfp.cjs +0 -49
  275. package/dist/state-C_1EOo3D.js +0 -12
  276. package/dist/state-Dg-53wQ8.cjs +0 -5
  277. package/dist/tabitem-CB8wkKmv.js +0 -332
  278. package/dist/tabitem-DZpspU4Q.cjs +0 -65
  279. package/dist/tag-BuCpqaks.js +0 -115
  280. package/dist/tag-X6xdjR0N.cjs +0 -27
  281. package/dist/textarea-Bzuymclz.js +0 -131
  282. package/dist/textarea-DoeHJ7HR.cjs +0 -50
  283. package/dist/textinput-9lHjs4ce.js +0 -150
  284. package/dist/textinput-BNsLd26i.cjs +0 -70
  285. package/dist/utils-DznhwRXm.js +0 -8
  286. package/dist/utils-byXsEz1u.cjs +0 -1
@@ -0,0 +1 @@
1
+ const e=require(`./element-DjtxO-1r.cjs`);var t=class extends e.n{constructor(...e){super(...e),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`heading`),this.setAttribute(`aria-level`,String(this.level)),this.updateHostClasses()}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`level`&&n&&this.setLevel(Number(n)),e===`visuallyHidden`&&(this.visuallyHidden=n!==null&&n!==`false`),(e===`size`||e===`visuallyHidden`||e===`align`||e===`weight`)&&this.updateHostClasses()}updated(e){super.updated(e),e.has(`level`)&&(this.setLevel(this.level),this.hasAttribute(`size`)||(this.size=this.defaultSizeForLevel),this.hasAttribute(`weight`)||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute(`size`)&&(e.has(`level`)||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(e.has(`size`)||e.has(`visuallyHidden`)||e.has(`align`)||e.has(`weight`))&&this.updateHostClasses()}setLevel(e){e>=1&&e<=6?(this.level=e,this.setAttribute(`aria-level`,String(e))):console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return`xlarge`;case 2:return`large`;case 3:return`medium`;case 4:return`small`;case 5:return`xsmall`;case 6:return`xsmall`;default:return`medium`}}get defaultWeightForLevel(){switch(this.level){case 1:return`regular`;case 2:return`regular`;case 3:return`medium`;case 4:return`medium`;case 5:return`medium`;case 6:return`medium`;default:return`medium`}}updateHostClasses(){this.classList.remove(`pkt-heading`,`pkt-heading--xsmall`,`pkt-heading--small`,`pkt-heading--medium`,`pkt-heading--large`,`pkt-heading--xlarge`,`pkt-sr-only`,`pkt-heading--start`,`pkt-heading--center`,`pkt-heading--end`,`pkt-heading--light`,`pkt-heading--regular`,`pkt-heading--medium`,`pkt-heading--bold`),this.classList.add(`pkt-heading`),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.weight&&this.classList.add(`pkt-heading--fw-${this.weight}`),this.visuallyHidden&&this.classList.add(`pkt-sr-only`),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return e.d`<slot></slot>`}};e.r([e.s({type:String,reflect:!0})],t.prototype,`size`,void 0),e.r([e.s({type:Number,reflect:!0})],t.prototype,`level`,void 0),e.r([e.s({type:String,reflect:!0})],t.prototype,`weight`,void 0),e.r([e.s({type:Boolean,reflect:!0})],t.prototype,`visuallyHidden`,void 0),e.r([e.s({type:String,reflect:!0})],t.prototype,`align`,void 0);try{e.c(`pkt-heading`)(t)}catch{console.warn(`Forsøker å definere <pkt-heading>, men den er allerede definert`)}var n=t;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
@@ -0,0 +1,73 @@
1
+ import { c as e, d as t, n, r, s as i } from "./element-cZ85T_aa.js";
2
+ //#region src/components/heading/heading.ts
3
+ var a = class extends n {
4
+ constructor(...e) {
5
+ super(...e), this.size = void 0, this.level = 2, this.weight = void 0, this.visuallyHidden = !1, this.align = void 0;
6
+ }
7
+ connectedCallback() {
8
+ super.connectedCallback(), this.setAttribute("role", "heading"), this.setAttribute("aria-level", String(this.level)), this.updateHostClasses();
9
+ }
10
+ attributeChangedCallback(e, t, n) {
11
+ super.attributeChangedCallback(e, t, n), e === "level" && n && this.setLevel(Number(n)), e === "visuallyHidden" && (this.visuallyHidden = n !== null && n !== "false"), (e === "size" || e === "visuallyHidden" || e === "align" || e === "weight") && this.updateHostClasses();
12
+ }
13
+ updated(e) {
14
+ super.updated(e), e.has("level") && (this.setLevel(this.level), this.hasAttribute("size") || (this.size = this.defaultSizeForLevel), this.hasAttribute("weight") || (this.weight = this.defaultWeightForLevel)), !this.hasAttribute("size") && (e.has("level") || this.size === void 0) && (this.size = this.defaultSizeForLevel), (e.has("size") || e.has("visuallyHidden") || e.has("align") || e.has("weight")) && this.updateHostClasses();
15
+ }
16
+ setLevel(e) {
17
+ e >= 1 && e <= 6 ? (this.level = e, this.setAttribute("aria-level", String(e))) : console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`);
18
+ }
19
+ get defaultSizeForLevel() {
20
+ switch (this.level) {
21
+ case 1: return "xlarge";
22
+ case 2: return "large";
23
+ case 3: return "medium";
24
+ case 4: return "small";
25
+ case 5: return "xsmall";
26
+ case 6: return "xsmall";
27
+ default: return "medium";
28
+ }
29
+ }
30
+ get defaultWeightForLevel() {
31
+ switch (this.level) {
32
+ case 1: return "regular";
33
+ case 2: return "regular";
34
+ case 3: return "medium";
35
+ case 4: return "medium";
36
+ case 5: return "medium";
37
+ case 6: return "medium";
38
+ default: return "medium";
39
+ }
40
+ }
41
+ updateHostClasses() {
42
+ this.classList.remove("pkt-heading", "pkt-heading--xsmall", "pkt-heading--small", "pkt-heading--medium", "pkt-heading--large", "pkt-heading--xlarge", "pkt-sr-only", "pkt-heading--start", "pkt-heading--center", "pkt-heading--end", "pkt-heading--light", "pkt-heading--regular", "pkt-heading--medium", "pkt-heading--bold"), this.classList.add("pkt-heading"), this.size && this.classList.add(`pkt-heading--${this.size}`), this.weight && this.classList.add(`pkt-heading--fw-${this.weight}`), this.visuallyHidden && this.classList.add("pkt-sr-only"), this.align && this.classList.add(`pkt-heading--${this.align}`);
43
+ }
44
+ render() {
45
+ return t`<slot></slot>`;
46
+ }
47
+ };
48
+ r([i({
49
+ type: String,
50
+ reflect: !0
51
+ })], a.prototype, "size", void 0), r([i({
52
+ type: Number,
53
+ reflect: !0
54
+ })], a.prototype, "level", void 0), r([i({
55
+ type: String,
56
+ reflect: !0
57
+ })], a.prototype, "weight", void 0), r([i({
58
+ type: Boolean,
59
+ reflect: !0
60
+ })], a.prototype, "visuallyHidden", void 0), r([i({
61
+ type: String,
62
+ reflect: !0
63
+ })], a.prototype, "align", void 0);
64
+ try {
65
+ e("pkt-heading")(a);
66
+ } catch {
67
+ console.warn("Forsøker å definere <pkt-heading>, men den er allerede definert");
68
+ }
69
+ //#endregion
70
+ //#region src/components/heading/index.ts
71
+ var o = a;
72
+ //#endregion
73
+ export { a as n, o as t };
@@ -0,0 +1,65 @@
1
+ import { c as e, d as t, l as n, o as r, r as i, s as a } from "./element-cZ85T_aa.js";
2
+ import { t as o } from "./class-map-C8HuhNzZ.js";
3
+ import { n as s, t as c } from "./element-with-slot-4J2o3SeU.js";
4
+ import { r as l } from "./icon-Co72KtgF.js";
5
+ import { n as u } from "./utils-CUqCKGvp.js";
6
+ import { t as d } from "./input-wrapper-CDyHTR1V.js";
7
+ //#region src/components/helptext/helptext.ts
8
+ var f = class extends c {
9
+ constructor(...e) {
10
+ super(...e), this.forId = u(), this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = d.props.helptextDropdownButton.default, this.isHelpTextOpen = !1;
11
+ }
12
+ render() {
13
+ return t`${t`<div class="${o({
14
+ "pkt-inputwrapper__helptext-container": !0,
15
+ "pkt-inputwrapper__has-helptext": this.helptext || this.helptextDropdown || this.hasSlotContent()
16
+ })}">
17
+ <div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
18
+ <div class="pkt-contents" name="helptext">${s(this)}</div>
19
+ ${this.helptext && l(this.helptext)}
20
+ </div>
21
+ ${this.helptextDropdown ? t`<div class="pkt-inputwrapper__helptext-expandable">
22
+ <button
23
+ class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
24
+ type="button"
25
+ @click=${() => {
26
+ let e = !this.isHelpTextOpen;
27
+ this.isHelpTextOpen = e, this.dispatchEvent(new CustomEvent("toggleHelpText", {
28
+ bubbles: !0,
29
+ detail: { isOpen: e }
30
+ }));
31
+ }}
32
+ >
33
+ <pkt-icon
34
+ class="pkt-btn__icon"
35
+ name="${this.isHelpTextOpen ? "chevron-thin-up" : "chevron-thin-down"}"
36
+ ></pkt-icon>
37
+ <span class="pkt-btn__text">${l(this.helptextDropdownButton)}</span>
38
+ </button>
39
+ <div
40
+ class="${o({
41
+ "pkt-inputwrapper__helptext": !0,
42
+ "pkt-inputwrapper__helptext-expandable-open": this.isHelpTextOpen,
43
+ "pkt-inputwrapper__helptext-expandable-closed": !this.isHelpTextOpen
44
+ })}"
45
+ >
46
+ ${l(this.helptextDropdown)}
47
+ </div>
48
+ </div>` : n}
49
+ </div>`}`;
50
+ }
51
+ };
52
+ i([a({
53
+ type: String,
54
+ reflect: !0
55
+ })], f.prototype, "forId", void 0), i([a({ type: String })], f.prototype, "helptext", void 0), i([a({ type: String })], f.prototype, "helptextDropdown", void 0), i([a({ type: String })], f.prototype, "helptextDropdownButton", void 0), i([r()], f.prototype, "isHelpTextOpen", void 0);
56
+ try {
57
+ e("pkt-helptext")(f);
58
+ } catch {
59
+ console.warn("Forsøker å definere <pkt-helptext>, men den er allerede definert");
60
+ }
61
+ //#endregion
62
+ //#region src/components/helptext/index.ts
63
+ var p = f;
64
+ //#endregion
65
+ export { f as n, p as t };
@@ -0,0 +1,24 @@
1
+ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),n=require(`./element-with-slot-CWoTGA1B.cjs`),r=require(`./icon-Dr8sfT2X.cjs`),i=require(`./utils-CjAbIttF.cjs`),a=require(`./input-wrapper-Dwd-_sKm.cjs`);var o=class extends n.t{constructor(...e){super(...e),this.forId=i.n(),this.helptext=``,this.helptextDropdown=``,this.helptextDropdownButton=a.t.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){let i=()=>{let e=!this.isHelpTextOpen;this.isHelpTextOpen=e,this.dispatchEvent(new CustomEvent(`toggleHelpText`,{bubbles:!0,detail:{isOpen:e}}))},a=t.t({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()});return e.d`${e.d`<div class="${a}">
2
+ <div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
3
+ <div class="pkt-contents" name="helptext">${n.n(this)}</div>
4
+ ${this.helptext&&r.r(this.helptext)}
5
+ </div>
6
+ ${this.helptextDropdown?e.d`<div class="pkt-inputwrapper__helptext-expandable">
7
+ <button
8
+ class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
9
+ type="button"
10
+ @click=${i}
11
+ >
12
+ <pkt-icon
13
+ class="pkt-btn__icon"
14
+ name="${this.isHelpTextOpen?`chevron-thin-up`:`chevron-thin-down`}"
15
+ ></pkt-icon>
16
+ <span class="pkt-btn__text">${r.r(this.helptextDropdownButton)}</span>
17
+ </button>
18
+ <div
19
+ class="${t.t({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
20
+ >
21
+ ${r.r(this.helptextDropdown)}
22
+ </div>
23
+ </div>`:e.l}
24
+ </div>`}`}};e.r([e.s({type:String,reflect:!0})],o.prototype,`forId`,void 0),e.r([e.s({type:String})],o.prototype,`helptext`,void 0),e.r([e.s({type:String})],o.prototype,`helptextDropdown`,void 0),e.r([e.s({type:String})],o.prototype,`helptextDropdownButton`,void 0),e.r([e.o()],o.prototype,`isHelpTextOpen`,void 0);try{e.c(`pkt-helptext`)(o)}catch{console.warn(`Forsøker å definere <pkt-helptext>, 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}});
@@ -0,0 +1,86 @@
1
+ import { c as e, d as t, l as n, r, s as i, t as a, u as o } from "./element-cZ85T_aa.js";
2
+ import { n as s, r as c, t as l } from "./directive-3THFsVew.js";
3
+ //#region ../../node_modules/lit-html/directives/unsafe-html.js
4
+ var u = class extends s {
5
+ constructor(e) {
6
+ if (super(e), this.it = n, e.type !== c.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
7
+ }
8
+ render(e) {
9
+ if (e === n || e == null) return this._t = void 0, this.it = e;
10
+ if (e === o) return e;
11
+ if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
12
+ if (e === this.it) return this._t;
13
+ this.it = e;
14
+ let t = [e];
15
+ return t.raw = t, this._t = {
16
+ _$litType$: this.constructor.resultType,
17
+ strings: t,
18
+ values: []
19
+ };
20
+ }
21
+ };
22
+ u.directiveName = "unsafeHTML", u.resultType = 1;
23
+ var d = l(u), f = class extends u {};
24
+ f.directiveName = "unsafeSVG", f.resultType = 2;
25
+ var p = l(f), m = "https://punkt-cdn.oslo.kommune.no/latest/icons/";
26
+ typeof window < "u" && (window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch, window.pktIconPath = window.pktIconPath || m);
27
+ var h = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>", g = {}, _ = 2, v = 1500, y = typeof Storage < "u" && typeof sessionStorage < "u", b = (e) => window.pktFetch(e).then((t) => {
28
+ if (!t.ok) throw Error("Missing icon: " + e);
29
+ return t.text();
30
+ }), x = async (e, t = _) => {
31
+ try {
32
+ return await b(e);
33
+ } catch {
34
+ return t > 0 ? (await new Promise((e) => setTimeout(e, v)), x(e, t - 1)) : (console.error("Failed to fetch icon: " + e), h);
35
+ }
36
+ }, S = async (e, t) => {
37
+ let n = t + e + ".svg";
38
+ return y && sessionStorage.getItem(n) ? sessionStorage.getItem(n) : n in g ? g[n] : typeof window < "u" && typeof window.pktFetch == "function" ? (g[n] = x(n).then((e) => (e !== h && y && sessionStorage.setItem(n, e), delete g[n], e)), g[n]) : h;
39
+ }, C = class extends a {
40
+ constructor(...e) {
41
+ super(...e), this.path = typeof window < "u" ? window.pktIconPath : m, this.name = "", this.icon = p(h), this._updatedProps = [];
42
+ }
43
+ connectedCallback() {
44
+ super.connectedCallback(), this.classList.add("pkt-icon");
45
+ }
46
+ async attributeChangedCallback(e, t, n) {
47
+ super.attributeChangedCallback(e, t, n), (e === "name" || e === "path") && this.getIcon(this.name);
48
+ }
49
+ async updated(e) {
50
+ super.updated(e), (e.has("name") || e.has("path")) && this.getIcon(this.name);
51
+ }
52
+ async getIcon(e = "") {
53
+ if (this._updatedProps.length > 0) {
54
+ this.path ||= typeof window < "u" ? window.pktIconPath : m;
55
+ try {
56
+ this.icon = p(await S(this.name || "", this.path));
57
+ } catch {
58
+ this.icon = p(h);
59
+ }
60
+ this._updatedProps = [];
61
+ } else this._updatedProps.includes(e) || this._updatedProps.push(e);
62
+ }
63
+ render() {
64
+ return t`${this.name && this.icon}`;
65
+ }
66
+ };
67
+ r([i({
68
+ type: String,
69
+ reflect: !1
70
+ })], C.prototype, "path", void 0), r([i({
71
+ type: String,
72
+ reflect: !0
73
+ })], C.prototype, "name", void 0), r([i({ type: SVGElement })], C.prototype, "icon", void 0), r([i({
74
+ type: Array,
75
+ noAccessor: !0
76
+ })], C.prototype, "_updatedProps", void 0);
77
+ try {
78
+ e("pkt-icon")(C);
79
+ } catch {
80
+ console.warn("Forsøker å definere <pkt-icon>, men den er allerede definert");
81
+ }
82
+ //#endregion
83
+ //#region src/components/icon/index.ts
84
+ var w = C;
85
+ //#endregion
86
+ export { C as n, d as r, w as t };
@@ -0,0 +1 @@
1
+ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./directive-CJ2giQBZ.cjs`);var n=class extends t.n{constructor(n){if(super(n),this.it=e.l,n.type!==t.r.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(t){if(t===e.l||t==null)return this._t=void 0,this.it=t;if(t===e.u)return t;if(typeof t!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(t===this.it)return this._t;this.it=t;let n=[t];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}};n.directiveName=`unsafeHTML`,n.resultType=1;var r=t.t(n),i=class extends n{};i.directiveName=`unsafeSVG`,i.resultType=2;var a=t.t(i),o=`https://punkt-cdn.oslo.kommune.no/latest/icons/`;typeof window<`u`&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||o);var s=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>`,c={},l=2,u=1500,d=typeof Storage<`u`&&typeof sessionStorage<`u`,f=e=>window.pktFetch(e).then(t=>{if(!t.ok)throw Error(`Missing icon: `+e);return t.text()}),p=async(e,t=l)=>{try{return await f(e)}catch{return t>0?(await new Promise(e=>setTimeout(e,u)),p(e,t-1)):(console.error(`Failed to fetch icon: `+e),s)}},m=async(e,t)=>{let n=t+e+`.svg`;return d&&sessionStorage.getItem(n)?sessionStorage.getItem(n):n in c?c[n]:typeof window<`u`&&typeof window.pktFetch==`function`?(c[n]=p(n).then(e=>(e!==s&&d&&sessionStorage.setItem(n,e),delete c[n],e)),c[n]):s},h=class extends e.t{constructor(...e){super(...e),this.path=typeof window<`u`?window.pktIconPath:o,this.name=``,this.icon=a(s),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-icon`)}async attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),(e===`name`||e===`path`)&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has(`name`)||e.has(`path`))&&this.getIcon(this.name)}async getIcon(e=``){if(this._updatedProps.length>0){this.path||=typeof window<`u`?window.pktIconPath:o;try{this.icon=a(await m(this.name||``,this.path))}catch{this.icon=a(s)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return e.d`${this.name&&this.icon}`}};e.r([e.s({type:String,reflect:!1})],h.prototype,`path`,void 0),e.r([e.s({type:String,reflect:!0})],h.prototype,`name`,void 0),e.r([e.s({type:SVGElement})],h.prototype,`icon`,void 0),e.r([e.s({type:Array,noAccessor:!0})],h.prototype,`_updatedProps`,void 0);try{e.c(`pkt-icon`)(h)}catch{console.warn(`Forsøker å definere <pkt-icon>, men den er allerede definert`)}var g=h;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}});
@@ -0,0 +1,5 @@
1
+ import { l as e } from "./element-cZ85T_aa.js";
2
+ //#region ../../node_modules/lit-html/directives/if-defined.js
3
+ var t = (t) => t ?? e;
4
+ //#endregion
5
+ export { t };
@@ -0,0 +1 @@
1
+ const e=require(`./element-DjtxO-1r.cjs`);var t=t=>t??e.l;Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
package/dist/index.d.ts CHANGED
@@ -194,7 +194,6 @@ declare interface IPktAlert {
194
194
  title?: string;
195
195
  date?: string | null;
196
196
  ariaLive?: TAriaLive | null;
197
- 'aria-live'?: TAriaLive | null;
198
197
  compact?: boolean;
199
198
  role?: string;
200
199
  }
@@ -551,7 +550,7 @@ export declare class PktAlert extends PktElementWithSlot implements IPktAlert {
551
550
  title: string;
552
551
  skin: TAlertSkin;
553
552
  ariaLive: TAriaLive;
554
- 'aria-live': TAriaLive | null;
553
+ ariaLiveAttr: TAriaLive | null;
555
554
  closeAlert: boolean;
556
555
  date: string | null;
557
556
  role: string;
@@ -0,0 +1 @@
1
+ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1B.cjs`),n=require(`./utils-CjAbIttF.cjs`),r=require(`./booleanish-jJLlnr6-.cjs`),i=require(`./input-wrapper-Dwd-_sKm.cjs`);(function(e){"use strict";let t=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,s=new WeakMap,c=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,g={ariaAtomic:`aria-atomic`,ariaAutoComplete:`aria-autocomplete`,ariaBusy:`aria-busy`,ariaChecked:`aria-checked`,ariaColCount:`aria-colcount`,ariaColIndex:`aria-colindex`,ariaColIndexText:`aria-colindextext`,ariaColSpan:`aria-colspan`,ariaCurrent:`aria-current`,ariaDescription:`aria-description`,ariaDisabled:`aria-disabled`,ariaExpanded:`aria-expanded`,ariaHasPopup:`aria-haspopup`,ariaHidden:`aria-hidden`,ariaInvalid:`aria-invalid`,ariaKeyShortcuts:`aria-keyshortcuts`,ariaLabel:`aria-label`,ariaLevel:`aria-level`,ariaLive:`aria-live`,ariaModal:`aria-modal`,ariaMultiLine:`aria-multiline`,ariaMultiSelectable:`aria-multiselectable`,ariaOrientation:`aria-orientation`,ariaPlaceholder:`aria-placeholder`,ariaPosInSet:`aria-posinset`,ariaPressed:`aria-pressed`,ariaReadOnly:`aria-readonly`,ariaRelevant:`aria-relevant`,ariaRequired:`aria-required`,ariaRoleDescription:`aria-roledescription`,ariaRowCount:`aria-rowcount`,ariaRowIndex:`aria-rowindex`,ariaRowIndexText:`aria-rowindextext`,ariaRowSpan:`aria-rowspan`,ariaSelected:`aria-selected`,ariaSetSize:`aria-setsize`,ariaSort:`aria-sort`,ariaValueMax:`aria-valuemax`,ariaValueMin:`aria-valuemin`,ariaValueNow:`aria-valuenow`,ariaValueText:`aria-valuetext`,role:`role`},_=(e,t)=>{for(let n in g){t[n]=null;let r=null,i=g[n];Object.defineProperty(t,n,{get(){return r},set(n){r=n,e.isConnected?T(e,i,n):u.set(e,t)}})}};function v(e){let t=i.get(e),{form:n}=t;P(e,n,t),A(e,t.labels)}let y=(e,t=!1)=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return i.has(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode(),a=!t||e.disabled;for(;r;)r.formDisabledCallback&&a&&E(r,e.disabled),r=n.nextNode()},b={attributes:!0,attributeFilter:[`disabled`,`name`]},x=z()?new MutationObserver(e=>{for(let t of e){let e=t.target;if(t.attributeName===`disabled`&&(e.constructor.formAssociated?E(e,e.hasAttribute(`disabled`)):e.localName===`fieldset`&&y(e)),t.attributeName===`name`&&e.constructor.formAssociated){let t=i.get(e),n=l.get(e);t.setFormValue(n)}}}):{};function S(e){e.forEach(e=>{let{addedNodes:t,removedNodes:n}=e,a=Array.from(t),o=Array.from(n);a.forEach(e=>{var t;if(i.has(e)&&e.constructor.formAssociated&&v(e),u.has(e)){let t=u.get(e);Object.keys(g).filter(e=>t[e]!==null).forEach(n=>{T(e,g[n],t[n])}),u.delete(e)}if(h.has(e)){let t=h.get(e);T(e,`internals-valid`,t.validity.valid.toString()),T(e,`internals-invalid`,(!t.validity.valid).toString()),T(e,`aria-invalid`,(!t.validity.valid).toString()),h.delete(e)}if(e.localName===`form`){let t=c.get(e),n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return i.has(e)&&e.constructor.formAssociated&&!(t&&t.has(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode();for(;r;)v(r),r=n.nextNode()}e.localName===`fieldset`&&((t=x.observe)==null||t.call(x,e,b),y(e,!0))}),o.forEach(e=>{let t=i.get(e);t&&r.get(t)&&D(t),s.has(e)&&s.get(e).disconnect()})})}function C(e){e.forEach(e=>{let{removedNodes:t}=e;t.forEach(t=>{let n=p.get(e.target);i.has(t)&&R(t),n.disconnect()})})}let ee=e=>{var t;let n=new MutationObserver(C);(window==null?void 0:window.ShadyDOM)?.inUse&&e.mode&&e.host&&(e=e.host),(t=n.observe)==null||t.call(n,e,{childList:!0}),p.set(e,n)};z()&&new MutationObserver(S);let w={childList:!0,subtree:!0},T=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},E=(e,t)=>{e.toggleAttribute(`internals-disabled`,t),t?T(e,`aria-disabled`,`true`):e.removeAttribute(`aria-disabled`),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},D=e=>{r.get(e).forEach(e=>{e.remove()}),r.set(e,[])},O=(e,t)=>{let n=document.createElement(`input`);return n.type=`hidden`,n.name=e.getAttribute(`name`),e.after(n),r.get(t).push(n),n},k=(e,t)=>{var n;r.set(t,[]),(n=x.observe)==null||n.call(x,e,b)},A=(e,t)=>{if(t.length){Array.from(t).forEach(t=>t.addEventListener(`click`,e.click.bind(e)));let n=t[0].id;t[0].id||(n=`${t[0].htmlFor}_Label`,t[0].id=n),T(e,`aria-labelledby`,n)}},j=e=>{let t=Array.from(e.elements).filter(e=>!e.tagName.includes(`-`)&&e.validity).map(e=>e.validity.valid),n=c.get(e)||[],r=Array.from(n).filter(e=>e.isConnected).map(e=>i.get(e).validity.valid),a=[...t,...r].includes(!1);e.toggleAttribute(`internals-invalid`,a),e.toggleAttribute(`internals-valid`,!a)},M=e=>{j(F(e.target))},N=e=>{j(F(e.target))},te=e=>{let t=[`button[type=submit]`,`input[type=submit]`,`button:not([type])`].map(e=>`${e}:not([disabled])`).map(t=>`${t}:not([form])${e.id?`,${t}[form='${e.id}']`:``}`).join(`,`);e.addEventListener(`click`,n=>{if(n.target.closest(t)){let t=c.get(e);if(e.noValidate)return;t.size&&Array.from(t).reverse().map(e=>i.get(e).reportValidity()).includes(!1)&&n.preventDefault()}})},ne=e=>{let t=c.get(e.target);t&&t.size&&t.forEach(e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)})},P=(e,t,n)=>{if(t){let r=c.get(t);if(r)r.add(e);else{let n=new Set;n.add(e),c.set(t,n),te(t),t.addEventListener(`reset`,ne),t.addEventListener(`input`,M),t.addEventListener(`change`,N)}o.set(t,{ref:e,internals:n}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),j(t)}},F=e=>{let t=e.parentNode;return t&&t.tagName!==`FORM`&&(t=F(t)),t},I=(e,t,n=DOMException)=>{if(!e.constructor.formAssociated)throw new n(t)},L=(e,t,n)=>{let r=c.get(e);return r&&r.size&&r.forEach(e=>{i.get(e)[n]()||(t=!1)}),t},R=e=>{if(e.constructor.formAssociated){let t=i.get(e),{labels:n,form:r}=t;A(e,n),P(e,r,t)}};function z(){return typeof MutationObserver<`u`}class B{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}let re=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),ie=(e,t,n)=>(e.valid=V(t),Object.keys(t).forEach(n=>e[n]=t[n]),n&&j(n),e),V=e=>{let t=!0;for(let n in e)n!==`valid`&&e[n]!==!1&&(t=!1);return t},H=new WeakMap;function U(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class W extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);H.set(this,e)}add(e){if(!/^--/.test(e)||typeof e!=`string`)throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${e} must start with '--'.`);let t=super.add(e),n=H.get(this),r=`state${e}`;return n.isConnected?U(n,r):setTimeout(()=>{U(n,r)}),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){let t=super.delete(e),n=H.get(this);return n.isConnected?(n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)):setTimeout(()=>{n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)}),t}}function G(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function K(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}var q;class J{constructor(e){q.set(this,void 0),K(this,q,e,`f`);for(let t=0;t<e.length;t++){let n=e[t];this[t]=n,n.hasAttribute(`name`)&&(this[n.getAttribute(`name`)]=n)}Object.freeze(this)}get length(){return G(this,q,`f`).length}[(q=new WeakMap,Symbol.iterator)](){return G(this,q,`f`)[Symbol.iterator]()}item(e){return this[e]==null?null:this[e]}namedItem(e){return this[e]==null?null:this[e]}}function ae(){let e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=n;let t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=r;function n(...t){let n=e.apply(this,t);return L(this,n,`checkValidity`)}function r(...e){let n=t.apply(this,e);return L(this,n,`reportValidity`)}let{get:i}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`elements`);Object.defineProperty(HTMLFormElement.prototype,`elements`,{get(...e){let t=i.call(this,...e),n=Array.from(c.get(this)||[]);return n.length===0?t:new J(Array.from(t).concat(n).sort((e,t)=>e.compareDocumentPosition?e.compareDocumentPosition(t)&2?1:-1:0))}})}class Y{static get isPolyfilled(){return!0}constructor(e){if(!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);let r=e.getRootNode(),a=new B;this.states=new W(e),t.set(this,e),n.set(this,a),i.set(e,this),_(e,this),k(e,this),Object.seal(this),r instanceof DocumentFragment&&ee(r)}checkValidity(){let e=t.get(this);if(I(e,`Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let r=n.get(this);if(!r.valid){let t=new Event(`invalid`,{bubbles:!1,cancelable:!0,composed:!1});e.dispatchEvent(t)}return r.valid}get form(){let e=t.get(this);I(e,`Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.`);let n;return e.constructor.formAssociated===!0&&(n=F(e)),n}get labels(){let e=t.get(this);I(e,`Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.`);let n=e.getAttribute(`id`),r=e.getRootNode();return r&&n?r.querySelectorAll(`[for="${n}"]`):[]}reportValidity(){let e=t.get(this);if(I(e,`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let n=this.checkValidity(),r=f.get(this);if(r&&!e.constructor.formAssociated)throw new DOMException(`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);return!n&&r&&(e.focus(),r.focus()),n}setFormValue(e){let n=t.get(this);if(I(n,`Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element.`),D(this),e!=null&&!(e instanceof FormData)){if(n.getAttribute(`name`)){let t=O(n,this);t.value=e}}else e!=null&&e instanceof FormData&&Array.from(e).reverse().forEach(([e,t])=>{if(typeof t==`string`){let r=O(n,this);r.name=e,r.value=t}});l.set(n,e)}setValidity(e,r,i){let o=t.get(this);if(I(o,`Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!e)throw TypeError(`Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.`);f.set(this,i);let s=n.get(this),c={};for(let t in e)c[t]=e[t];Object.keys(c).length===0&&re(s);let l=Object.assign(Object.assign({},s),c);delete l.valid;let{valid:u}=ie(s,l,this.form);if(!u&&!r)throw new DOMException(`Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.`);a.set(this,u?``:r),o.isConnected?(o.toggleAttribute(`internals-invalid`,!u),o.toggleAttribute(`internals-valid`,u),T(o,`aria-invalid`,`${!u}`)):h.set(o,this)}get shadowRoot(){let e=t.get(this);return d.get(e)||null}get validationMessage(){return I(t.get(this),`Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element.`),a.get(this)}get validity(){return I(t.get(this),`Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.`),n.get(this)}get willValidate(){let e=t.get(this);return I(e,`Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element.`),!(e.disabled||e.hasAttribute(`disabled`)||e.hasAttribute(`readonly`))}}function oe(){if(typeof window>`u`||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}let t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,``)}`;customElements.define(t,e);let n=new e;return[`shadowRoot`,`form`,`willValidate`,`validity`,`validationMessage`,`labels`,`setFormValue`,`setValidity`,`checkValidity`,`reportValidity`].every(e=>e in n.internals)}let X=!1,Z=!1;function Q(e){Z||(Z=!0,window.CustomStateSet=W,e&&(HTMLElement.prototype.attachInternals=function(...t){let n=e.call(this,t);return n.states=new W(this),n}))}function $(e=!0){if(!X){if(X=!0,typeof window<`u`&&(window.ElementInternals=Y),typeof CustomElementRegistry<`u`){let e=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(t,n,r){if(n.formAssociated){let e=n.prototype.connectedCallback;n.prototype.connectedCallback=function(){m.has(this)||(m.set(this,!0),this.hasAttribute(`disabled`)&&E(this,!0)),e?.apply(this),R(this)}}e.call(this,t,n,r)}}if(typeof HTMLElement<`u`&&(HTMLElement.prototype.attachInternals=function(){if(!this.tagName)return{};if(this.tagName.indexOf(`-`)===-1)throw Error(`Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.`);if(i.has(this))throw new DOMException(`DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);return new Y(this)}),typeof Element<`u`){function e(...e){let n=t.apply(this,e);if(d.set(this,n),z()){let e=new MutationObserver(S);window.ShadyDOM?e.observe(this,w):e.observe(n,w),s.set(this,e)}return n}let t=Element.prototype.attachShadow;Element.prototype.attachShadow=e}z()&&typeof document<`u`&&new MutationObserver(S).observe(document.documentElement,w),typeof HTMLFormElement<`u`&&ae(),(e||typeof window<`u`&&!window.CustomStateSet)&&Q()}}return customElements.polyfillWrapFlushCallback||(oe()?typeof window<`u`&&!window.CustomStateSet&&Q(HTMLElement.prototype.attachInternals):$(!1)),e.forceCustomStateSetPolyfill=Q,e.forceElementInternalsPolyfill=$,Object.defineProperty(e,`__esModule`,{value:!0}),e})({});var a=`on`,o=`--checked`,s=`,`,c=class extends t.t{static get formAssociated(){return!0}constructor(){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=n.n(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,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=i.t.props.helptextDropdownButton.default,this.label=null,this.optionalText=e.i.forms.labels.optional,this.requiredText=e.i.forms.labels.required,this.tagText=null,this.dataTestid=``,this.touched=!1,this.internals=this.attachInternals()}manageValidity(t){if(!t){console.warn(`manageValidity called without valid input element`);return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},e.i.forms.messages.required,t):t.validity?.typeMismatch||t.validity?.badInput?this.internals.setValidity({typeMismatch:!0},e.i.forms.messages.invalid,t):t.validity?.patternMismatch?this.internals.setValidity({patternMismatch:!0},e.i.forms.messages.invalidPattern,t):t.validity?.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},e.i.forms.messages.tooShort,t):t.validity?.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},e.i.forms.messages.tooLong,t):t.validity?.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?e.i.forms.messages.rangeUnderflowMin.replace(`{min}`,this.min?.toString()):e.i.forms.messages.rangeUnderflow,t):t.validity?.stepMismatch?this.internals.setValidity({stepMismatch:!0},e.i.forms.messages.invalid,t):t.validity?.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?e.i.forms.messages.rangeOverflowMax.replace(`{max}`,this.max?.toString()):e.i.forms.messages.rangeOverflow,t):t.validity?.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({})}setFormValue(e){if(this.internals)if(Array.isArray(e)){let t=new FormData;e.forEach(e=>{t.append(this.name,e)}),this.internals.setFormValue(t)}else this.internals.setFormValue(e)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!==`radio`)return;let e=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(e).forEach(e=>{if(e!==this&&e.getAttribute(`name`)===this.name&&e.getAttribute(`value`)!==this.value){let t=e;t.checked&&(t.checked=!1,t.internals&&(t.internals.setFormValue(null),t.internals.states?.delete(o)))}})}valueChecked(e){if(!this.touched)return;let t=this.internals.form||this.closest(`form`),n=t?new FormData(t):null;if(this.type===`radio`&&this.coordinateRadioGroup(),typeof e==`string`?(this.checked=e===`true`,this.internals.ariaChecked=String(e===`true`)):typeof e==`boolean`&&(this.checked=e,this.internals.ariaChecked=String(e)),this.checked){let e=(typeof this.value==`string`?this.value:``)||a;this.internals.setFormValue(e),n&&n.append(this.name,e),this.internals.states.add(o)}else this.internals.setFormValue(null),n&&n.delete(this.name),this.internals.states.delete(o);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(e,t){(t!==this.value||t!==this._value)&&(typeof e==`string`?((this.multiple||this.range)&&e.includes(s)&&(e=e.split(s)),this.value=e,this._value=Array.isArray(e)?e:[e]):Array.isArray(e)?(this.value=this.multiple||this.range?e:e[0],this._value=e):(this.value=``,this._value=[]),(!this.value||this.value.length===0)&&t&&t.length!==0?this.clearInputValue():this.value&&this.value.toString()!==t?.toString()&&this.onChange(this.value))}dispatchChangeEvents(e){this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`value-change`,{detail:e,bubbles:!0,composed:!0}))}clearInputValue(){let e=this.multiple||this.range?[]:``;this.value=e,this.setFormValue(e),this.dispatchChangeEvents(e)}onFocus(){this.dispatchEvent(new FocusEvent(`focus`,{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent(`blur`,{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0}))}normalizeValue(e){return(this.range||this.multiple)&&typeof e==`string`&&e.includes(s)?e.split(s):!this.multiple&&!this.range&&Array.isArray(e)?e[0]||``:e}validate(){this.inputRef?.value&&this.manageValidity(this.inputRef.value),this.inputRefTo?.value&&this.manageValidity(this.inputRefTo.value)}onChange(e){if(!this.touched){this.touched=!0,e&&this.setFormValue(e),this.validate();return}if(typeof e!=`string`&&!Array.isArray(e))return;let t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this.dispatchChangeEvents(t)}formResetCallback(){if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(e=>{`selected`in e&&(e.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked=`false`,this.internals.setFormValue(``),this.inputRef?.value&&`checked`in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue(``);let e=this.defaultValue||(this.multiple||this.range?[]:``);this.value=e,this._value=Array.isArray(e)?e:[e],this.valueChanged(this.value,null)}this.internals.ariaInvalid=`false`}updated(e){super.updated(e),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`)))}firstUpdated(e){if(super.firstUpdated(e),this.form||=this.internals.form||this.closest(`form`),this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=`true`,this.checked=!0),this.required&&(this.internals.ariaRequired=`true`),this.disabled&&(this.internals.ariaDisabled=`true`),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){let e=this.checked===``||this.checked===`true`||this.checked===!0;this.internals.ariaChecked=String(e);let t=e?(typeof this.value==`string`?this.value:``)||a:null;this.internals.setFormValue(t)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute(`form`,``),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute(`form`,``),this.manageValidity(this.inputRefTo.value))}};e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`checked`,void 0),e.r([e.s({type:Boolean})],c.prototype,`defaultChecked`,void 0),e.r([e.s({type:Boolean})],c.prototype,`multiple`,void 0),e.r([e.s({type:Boolean})],c.prototype,`range`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`type`,void 0),e.r([e.s()],c.prototype,`defaultValue`,void 0),e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`disabled`,void 0),e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`readonly`,void 0),e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`required`,void 0),e.r([e.s({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],c.prototype,`max`,void 0),e.r([e.s({type:Number,reflect:!0})],c.prototype,`maxlength`,void 0),e.r([e.s({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],c.prototype,`min`,void 0),e.r([e.s({type:Number,reflect:!0})],c.prototype,`minlength`,void 0),e.r([e.s({type:Number,reflect:!0})],c.prototype,`step`,void 0),e.r([e.s({type:String})],c.prototype,`ariaDescribedBy`,void 0),e.r([e.s({type:String})],c.prototype,`ariaLabelledby`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`name`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`pattern`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`placeholder`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`id`,void 0),e.r([e.s({type:Boolean})],c.prototype,`counter`,void 0),e.r([e.s({type:Boolean})],c.prototype,`hasError`,void 0),e.r([e.s({type:Boolean})],c.prototype,`inline`,void 0),e.r([e.s({type:Boolean})],c.prototype,`hasFieldset`,void 0),e.r([e.s({type:Boolean})],c.prototype,`optionalTag`,void 0),e.r([e.s({type:Boolean})],c.prototype,`requiredTag`,void 0),e.r([e.s({type:Boolean})],c.prototype,`skipForwardTestid`,void 0),e.r([e.s({type:Boolean,reflect:!0,converter:r.t})],c.prototype,`useWrapper`,void 0),e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`fullwidth`,void 0),e.r([e.s({type:Number})],c.prototype,`counterMaxLength`,void 0),e.r([e.s({type:String})],c.prototype,`errorMessage`,void 0),e.r([e.s({type:String})],c.prototype,`helptext`,void 0),e.r([e.s({type:String})],c.prototype,`helptextDropdown`,void 0),e.r([e.s({type:String,reflect:!1})],c.prototype,`helptextDropdownButton`,void 0),e.r([e.s({type:String})],c.prototype,`label`,void 0),e.r([e.s({type:String,reflect:!1})],c.prototype,`optionalText`,void 0),e.r([e.s({type:String,reflect:!1})],c.prototype,`requiredText`,void 0),e.r([e.s({type:String,reflect:!1})],c.prototype,`tagText`,void 0),e.r([e.s({type:String,attribute:`data-testid`})],c.prototype,`dataTestid`,void 0),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});