@oslokommune/punkt-elements 17.1.2 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/{accordion-BeLvLPrB.js → accordion-1_pdxTgJ.js} +27 -27
  3. package/dist/{accordion-B3GBlvUC.cjs → accordion-DobbH-Sv.cjs} +5 -5
  4. package/dist/{alert-Cs4Rmq_J.cjs → alert-COeHz6o2.cjs} +6 -6
  5. package/dist/{alert-DKK_Tb9J.js → alert-xspFetQ8.js} +26 -26
  6. package/dist/{async-directive-Da7TJpnq.cjs → async-directive-B5pcIMfO.cjs} +1 -1
  7. package/dist/{async-directive-BPf6K-V2.js → async-directive-D2Sht790.js} +5 -5
  8. package/dist/{backlink-D1y26pj3.js → backlink-C0jZFnZ2.js} +8 -8
  9. package/dist/{backlink-CMmrKTe4.cjs → backlink-ZMhqHaVs.cjs} +3 -3
  10. package/dist/base-elements/element.d.ts +13 -1
  11. package/dist/base-elements/input-element.d.ts +4 -2
  12. package/dist/{breadcrumbs-B6JGhJgC.cjs → breadcrumbs-BS64xd1s.cjs} +7 -7
  13. package/dist/{breadcrumbs-CcTQ3Grm.js → breadcrumbs-BvMownZN.js} +16 -16
  14. package/dist/{button-2-OSPJkj.js → button-C44vNLFC.js} +28 -28
  15. package/dist/{button-CE97NQIk.cjs → button-CR4CXtnj.cjs} +7 -7
  16. package/dist/{calendar-kn4SrtJy.cjs → calendar-DQ4byeom.cjs} +28 -27
  17. package/dist/{calendar-pOW3R5Pw.js → calendar-DgjCKMMV.js} +82 -68
  18. package/dist/{card-zQ0eKRMV.js → card-DhHqC265.js} +44 -44
  19. package/dist/{card-CETDFkxR.cjs → card-Dpqi6HVt.cjs} +26 -26
  20. package/dist/{checkbox-CH7NpINF.js → checkbox-BQ1K57AB.js} +23 -23
  21. package/dist/{checkbox-CQNr_sEg.cjs → checkbox-CXQxbiaX.cjs} +11 -11
  22. package/dist/{class-map-BeimMvPv.cjs → class-map-CzCE5pqG.cjs} +1 -1
  23. package/dist/{class-map-CnWCnBSX.js → class-map-F1DJHyb7.js} +3 -3
  24. package/dist/{combobox-Bvg0UO9w.cjs → combobox-BV4oDiII.cjs} +19 -18
  25. package/dist/{combobox-CRdYYlxu.js → combobox-DPck39I2.js} +55 -54
  26. package/dist/components/calendar/calendar.d.ts +21 -6
  27. package/dist/components/checkbox/checkbox.d.ts +4 -2
  28. package/dist/components/combobox/combobox-base.d.ts +2 -1
  29. package/dist/components/consent/strings.d.ts +1 -85
  30. package/dist/components/datepicker/datepicker-base.d.ts +0 -3
  31. package/dist/components/datepicker/datepicker-multiple.d.ts +0 -2
  32. package/dist/components/datepicker/datepicker-range.d.ts +0 -2
  33. package/dist/components/datepicker/datepicker-single.d.ts +0 -2
  34. package/dist/components/datepicker/datepicker-utils.d.ts +2 -1
  35. package/dist/components/fileupload/fileupload-base.d.ts +3 -2
  36. package/dist/components/header/header-service.d.ts +3 -1
  37. package/dist/components/header/header.d.ts +2 -1
  38. package/dist/components/helptext/helptext.d.ts +2 -1
  39. package/dist/components/index.d.ts +2 -0
  40. package/dist/components/input-wrapper/input-wrapper.d.ts +4 -2
  41. package/dist/components/radiobutton/radiobutton.d.ts +4 -2
  42. package/dist/components/searchinput/searchinput.d.ts +2 -1
  43. package/dist/{consent-DZEkhgJ1.js → consent-BneInZov.js} +10 -10
  44. package/dist/{consent-CyY3RyoC.cjs → consent-_N9foluG.cjs} +5 -5
  45. package/dist/controllers/strings-controller.d.ts +27 -0
  46. package/dist/{datepicker-VTqSDQk5.cjs → datepicker-9NX5qt2z.cjs} +38 -37
  47. package/dist/{datepicker-ButIas85.js → datepicker-nSSSr1U7.js} +104 -104
  48. package/dist/{directive-helpers-CI8YZqku.js → directive-helpers-BARw3nEZ.js} +1 -1
  49. package/dist/{directive-helpers-BlAV5EQD.cjs → directive-helpers-D6AAMFKs.cjs} +1 -1
  50. package/dist/docs/components/fileupload.d.ts +1 -0
  51. package/dist/element-B8OGznK0.cjs +2 -0
  52. package/dist/{element-ChsFgr_B.js → element-BKSPVgs2.js} +240 -100
  53. package/dist/{element-with-slot-Bj7nm7fO.cjs → element-with-slot-DTxILHVv.cjs} +1 -1
  54. package/dist/{element-with-slot-BvG9ctC-.js → element-with-slot-YUAUFRqw.js} +4 -4
  55. package/dist/fileupload-D05VSbEP.cjs +402 -0
  56. package/dist/{fileupload-D5IQ9HDe.js → fileupload-E0LGGNgj.js} +370 -380
  57. package/dist/{footer-DbYQUYNR.cjs → footer-DBApIdGh.cjs} +32 -32
  58. package/dist/{footer-DrR64HiK.js → footer-DYilVBMC.js} +91 -91
  59. package/dist/format-B8meU8Tm.cjs +1 -0
  60. package/dist/format-BTeSVkED.js +18 -0
  61. package/dist/{header-ClgIac6n.cjs → header-B7tbX-Ok.cjs} +84 -84
  62. package/dist/{header-menu-BAsUNKSx.cjs → header-menu-1FFWhvNc.cjs} +24 -24
  63. package/dist/{header-menu-hVPXsb8g.js → header-menu-D522-VTV.js} +75 -75
  64. package/dist/{header-KvJ1mGwA.js → header-v3GWAzOK.js} +267 -264
  65. package/dist/{heading-CFmiSuCQ.cjs → heading-CvytvcL7.cjs} +1 -1
  66. package/dist/{heading-g-_IUB5T.js → heading-rx_oSCqe.js} +16 -16
  67. package/dist/helptext-DYFdcylX.cjs +27 -0
  68. package/dist/{helptext-DZng1D5i.js → helptext-LShGPm-b.js} +18 -19
  69. package/dist/{icon-9iwd2F2l.cjs → icon-BmMC09mi.cjs} +1 -1
  70. package/dist/{icon-D-LA22xD.js → icon-HYU1f54x.js} +17 -17
  71. package/dist/{if-defined-CGzIlZ9-.js → if-defined-BF8XcDi5.js} +1 -1
  72. package/dist/if-defined-CVYApOgK.cjs +1 -0
  73. package/dist/{input-element-DBMNBplu.js → input-element-D07DmR34.js} +121 -120
  74. package/dist/input-element-DumGj_oJ.cjs +1 -0
  75. package/dist/input-wrapper-Cci_wTvD.js +308 -0
  76. package/dist/input-wrapper-DDfapoRX.cjs +58 -0
  77. package/dist/{link-DK7gvmnj.cjs → link-11g2ZNin.cjs} +4 -4
  78. package/dist/{link-D-Eqm5KH.js → link-CQK0SH4H.js} +13 -13
  79. package/dist/{linkcard-zqbg7Oqm.js → linkcard-B4GlmjJ6.js} +16 -16
  80. package/dist/linkcard-DNYsVlV6.cjs +13 -0
  81. package/dist/{listbox-Dc4rGdPi.cjs → listbox-BlFRhyI7.cjs} +15 -15
  82. package/dist/{listbox-va_E8afs.js → listbox-wd_OofyF.js} +100 -99
  83. package/dist/{loader-D_RDICnw.js → loader-0C3qVk16.js} +14 -14
  84. package/dist/{loader-CMUkVJmE.cjs → loader-B9u2qUlR.cjs} +5 -5
  85. package/dist/{messagebox-Cv8LaSxv.cjs → messagebox-BD5tGmT-.cjs} +5 -5
  86. package/dist/{messagebox-Cw-OWDya.js → messagebox-C-y1ICmr.js} +15 -15
  87. package/dist/{modal-BtInv031.cjs → modal-BzPGQYCs.cjs} +8 -8
  88. package/dist/{modal-D0t_X2dX.js → modal-Cghs3w-d.js} +20 -20
  89. package/dist/pkt-accordion.cjs +1 -1
  90. package/dist/pkt-accordion.js +1 -1
  91. package/dist/pkt-alert.cjs +1 -1
  92. package/dist/pkt-alert.js +1 -1
  93. package/dist/pkt-backlink.cjs +1 -1
  94. package/dist/pkt-backlink.js +1 -1
  95. package/dist/pkt-breadcrumbs.cjs +1 -1
  96. package/dist/pkt-breadcrumbs.js +1 -1
  97. package/dist/pkt-button.cjs +1 -1
  98. package/dist/pkt-button.js +1 -1
  99. package/dist/pkt-calendar.cjs +1 -1
  100. package/dist/pkt-calendar.js +1 -1
  101. package/dist/pkt-card.cjs +1 -1
  102. package/dist/pkt-card.js +1 -1
  103. package/dist/pkt-checkbox.cjs +1 -1
  104. package/dist/pkt-checkbox.js +1 -1
  105. package/dist/pkt-combobox.cjs +1 -1
  106. package/dist/pkt-combobox.js +1 -1
  107. package/dist/pkt-consent.cjs +1 -1
  108. package/dist/pkt-consent.js +1 -1
  109. package/dist/pkt-datepicker.cjs +1 -1
  110. package/dist/pkt-datepicker.js +1 -1
  111. package/dist/pkt-fileupload.cjs +1 -1
  112. package/dist/pkt-fileupload.js +1 -1
  113. package/dist/pkt-footer.cjs +1 -1
  114. package/dist/pkt-footer.js +1 -1
  115. package/dist/pkt-header-menu.cjs +1 -1
  116. package/dist/pkt-header-menu.js +1 -1
  117. package/dist/pkt-header.cjs +1 -1
  118. package/dist/pkt-header.js +1 -1
  119. package/dist/pkt-heading.cjs +1 -1
  120. package/dist/pkt-heading.js +1 -1
  121. package/dist/pkt-helptext.cjs +1 -1
  122. package/dist/pkt-helptext.js +1 -1
  123. package/dist/pkt-icon.cjs +1 -1
  124. package/dist/pkt-icon.js +1 -1
  125. package/dist/pkt-index.cjs +1 -1
  126. package/dist/pkt-index.js +35 -34
  127. package/dist/pkt-input-wrapper.cjs +1 -1
  128. package/dist/pkt-input-wrapper.js +1 -1
  129. package/dist/pkt-link.cjs +1 -1
  130. package/dist/pkt-link.js +1 -1
  131. package/dist/pkt-linkcard.cjs +1 -1
  132. package/dist/pkt-linkcard.js +1 -1
  133. package/dist/pkt-listbox.cjs +1 -1
  134. package/dist/pkt-listbox.js +1 -1
  135. package/dist/pkt-loader.cjs +1 -1
  136. package/dist/pkt-loader.js +1 -1
  137. package/dist/pkt-messagebox.cjs +1 -1
  138. package/dist/pkt-messagebox.js +1 -1
  139. package/dist/pkt-modal.cjs +1 -1
  140. package/dist/pkt-modal.js +1 -1
  141. package/dist/{pkt-options-controller-C5EBX2T0.cjs → pkt-options-controller-CEEAqXaB.cjs} +1 -1
  142. package/dist/{pkt-options-controller-B77vH3PE.js → pkt-options-controller-PtjhmTGk.js} +1 -1
  143. package/dist/pkt-progressbar.cjs +1 -1
  144. package/dist/pkt-progressbar.js +1 -1
  145. package/dist/pkt-radiobutton.cjs +1 -1
  146. package/dist/pkt-radiobutton.js +1 -1
  147. package/dist/pkt-searchinput.cjs +1 -1
  148. package/dist/pkt-searchinput.js +1 -1
  149. package/dist/pkt-select.cjs +1 -1
  150. package/dist/pkt-select.js +1 -1
  151. package/dist/pkt-tabs.cjs +1 -1
  152. package/dist/pkt-tabs.js +1 -1
  153. package/dist/pkt-tag.cjs +1 -1
  154. package/dist/pkt-tag.js +1 -1
  155. package/dist/pkt-textarea.cjs +1 -1
  156. package/dist/pkt-textarea.js +1 -1
  157. package/dist/pkt-textinput.cjs +1 -1
  158. package/dist/pkt-textinput.js +1 -1
  159. package/dist/pkt-timepicker.cjs +1 -1
  160. package/dist/pkt-timepicker.js +1 -1
  161. package/dist/{progressbar-CbcfLerF.js → progressbar-BexQQw1o.js} +21 -21
  162. package/dist/{progressbar-D5MmnQId.cjs → progressbar-X9mSvpjw.cjs} +5 -5
  163. package/dist/{radiobutton-BUnf3EPi.js → radiobutton-CkhTasn4.js} +24 -24
  164. package/dist/{radiobutton-DpsO1F-8.cjs → radiobutton-ln29Ad3U.cjs} +8 -8
  165. package/dist/{ref-CQoEIIp0.cjs → ref-CHbJYtKE.cjs} +1 -1
  166. package/dist/{ref-CWD6PjVd.js → ref-Chc_DZAb.js} +2 -2
  167. package/dist/{repeat-sY6B7fAT.cjs → repeat-CHDs__rN.cjs} +1 -1
  168. package/dist/{repeat-C02g7d5S.js → repeat-P9SMlKd5.js} +4 -4
  169. package/dist/searchinput-CPgMEAZZ.cjs +60 -0
  170. package/dist/{searchinput-DwnjsvJ1.js → searchinput-Da7dKHBH.js} +43 -43
  171. package/dist/{select-BOJi6H6T.cjs → select-DCuvdAuK.cjs} +4 -3
  172. package/dist/{select-DMre80qs.js → select-jabMSjft.js} +21 -20
  173. package/dist/shared-strings/consent.d.ts +71 -0
  174. package/dist/shared-strings/format.d.ts +21 -0
  175. package/dist/shared-strings/index.d.ts +14 -0
  176. package/dist/shared-strings/nb.d.ts +118 -0
  177. package/dist/shared-strings/resolve.d.ts +12 -0
  178. package/dist/shared-strings/store.d.ts +27 -0
  179. package/dist/shared-strings/types.d.ts +29 -0
  180. package/dist/shared-types/fileupload.d.ts +0 -27
  181. package/dist/shared-types/index.d.ts +1 -2
  182. package/dist/shared-utils/combobox/index.d.ts +1 -0
  183. package/dist/shared-utils/combobox/input-utils.d.ts +2 -1
  184. package/dist/shared-utils/combobox/messages.d.ts +7 -0
  185. package/dist/shared-utils/combobox/option-utils.d.ts +2 -1
  186. package/dist/shared-utils/combobox/selection-manager.d.ts +3 -2
  187. package/dist/{tabs-Cf9ai0FD.cjs → tabs-DV5CQNDL.cjs} +7 -7
  188. package/dist/{tabs-TvxgbrCF.js → tabs-D_hoi1zu.js} +32 -32
  189. package/dist/tag-BxYulmZn.cjs +27 -0
  190. package/dist/{tag-Ds6n1LIs.js → tag-DK5SgKry.js} +33 -32
  191. package/dist/tests/strings-override.test.d.ts +0 -0
  192. package/dist/{textarea-vfzIcXhX.js → textarea-BR7Riace.js} +30 -29
  193. package/dist/{textarea-BydiLM9Z.cjs → textarea-ffBD_VHq.cjs} +3 -2
  194. package/dist/{textinput-CMP2jPP_.js → textinput-CRNrsRNV.js} +28 -27
  195. package/dist/{textinput-DGdicNSx.cjs → textinput-CtHFzAux.cjs} +13 -12
  196. package/dist/timepicker-AfgJipo6.cjs +196 -0
  197. package/dist/{timepicker-ClwgYywH.js → timepicker-ixs_E5RY.js} +67 -64
  198. package/package.json +3 -3
  199. package/src/components/backlink/backlink.ts +1 -1
  200. package/src/components/breadcrumbs/breadcrumbs.ts +1 -1
  201. package/src/components/calendar/calendar.ts +56 -26
  202. package/src/components/checkbox/checkbox.test.ts +0 -2
  203. package/src/components/checkbox/checkbox.ts +8 -4
  204. package/src/components/combobox/combobox-base.ts +2 -1
  205. package/src/components/combobox/combobox-value.ts +10 -9
  206. package/src/components/combobox/combobox.selection.test.ts +5 -1
  207. package/src/components/combobox/combobox.ts +4 -1
  208. package/src/components/consent/strings.ts +1 -125
  209. package/src/components/datepicker/date-tags.ts +4 -1
  210. package/src/components/datepicker/datepicker-base.ts +2 -6
  211. package/src/components/datepicker/datepicker-multiple.ts +0 -3
  212. package/src/components/datepicker/datepicker-range.ts +4 -7
  213. package/src/components/datepicker/datepicker-single.ts +0 -3
  214. package/src/components/datepicker/datepicker-utils.test.ts +5 -5
  215. package/src/components/datepicker/datepicker-utils.ts +6 -11
  216. package/src/components/datepicker/datepicker.ts +8 -1
  217. package/src/components/fileupload/fileupload-base.ts +25 -16
  218. package/src/components/fileupload/fileupload-renderers.ts +2 -1
  219. package/src/components/fileupload/fileupload.test.ts +16 -0
  220. package/src/components/fileupload/fileupload.ts +19 -15
  221. package/src/components/header/header-global.ts +3 -3
  222. package/src/components/header/header-service.ts +13 -8
  223. package/src/components/header/header.ts +2 -1
  224. package/src/components/helptext/helptext.test.ts +1 -1
  225. package/src/components/helptext/helptext.ts +3 -3
  226. package/src/components/index.ts +9 -0
  227. package/src/components/input-wrapper/input-wrapper.ts +18 -10
  228. package/src/components/listbox/listbox.ts +3 -3
  229. package/src/components/radiobutton/radiobutton.ts +8 -4
  230. package/src/components/searchinput/searchinput.ts +5 -3
  231. package/src/components/select/select.ts +1 -0
  232. package/src/components/tag/tag.ts +2 -1
  233. package/src/components/textarea/textarea.ts +1 -0
  234. package/src/components/textinput/textinput.ts +1 -0
  235. package/src/components/timepicker/timepicker.ts +23 -21
  236. package/dist/element-BA8v6S7z.cjs +0 -2
  237. package/dist/fileupload-BeWiTAoW.cjs +0 -401
  238. package/dist/helptext-CTtKJcML.cjs +0 -27
  239. package/dist/if-defined-B89_ZeCj.cjs +0 -1
  240. package/dist/input-element-DYmQw-fH.cjs +0 -1
  241. package/dist/input-wrapper-BmxNvznr.js +0 -128
  242. package/dist/input-wrapper-D-fPaTbY.js +0 -176
  243. package/dist/input-wrapper-D5PR0rJn.cjs +0 -1
  244. package/dist/input-wrapper-Q-B-aBeb.cjs +0 -54
  245. package/dist/linkcard-B29cmZqh.cjs +0 -13
  246. package/dist/searchinput-Bh975rjX.cjs +0 -60
  247. package/dist/tag-CzojNU7z.cjs +0 -27
  248. package/dist/timepicker-DYrnLHqN.cjs +0 -195
  249. package/dist/translations/no.json.d.ts +0 -94
@@ -1,12 +1,12 @@
1
- import { a as e, d as t, n, o as r, p as i, s as a, t as o } from "./element-ChsFgr_B.js";
2
- import { t as s } from "./class-map-CnWCnBSX.js";
3
- import "./icon-D-LA22xD.js";
4
- import { t as c } from "./if-defined-CGzIlZ9-.js";
1
+ import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-BKSPVgs2.js";
2
+ import { t as s } from "./class-map-F1DJHyb7.js";
3
+ import "./icon-HYU1f54x.js";
4
+ import { t as c } from "./if-defined-BF8XcDi5.js";
5
5
  import { t as l } from "./focus-modality-controller-Dc2S-KqR.js";
6
6
  //#region src/components/searchinput/searchinput.ts
7
- var u = class extends o {
7
+ var u = class extends a {
8
8
  constructor(...e) {
9
- super(...e), this.appearance = "local", this.inputSize = "medium", this.disabled = !1, this.fullwidth = !1, this.id = "", this.placeholder = "Søk…", this.value = "", this.focusModality = new l(this, ".pkt-searchinput");
9
+ super(...e), this.appearance = "local", this.inputSize = "medium", this.disabled = !1, this.fullwidth = !1, this.id = "", this.value = "", this.focusModality = new l(this, ".pkt-searchinput");
10
10
  }
11
11
  willUpdate(e) {
12
12
  super.willUpdate(e);
@@ -45,32 +45,32 @@ var u = class extends o {
45
45
  });
46
46
  this.dispatchEvent(r) || e.preventDefault();
47
47
  }
48
- renderSuggestion(e, n) {
49
- let r = i`
50
- ${e.title ? i`<h3 class="pkt-searchinput__suggestion-title">${e.title}</h3>` : t}
51
- ${e.text ? i`<p class="pkt-searchinput__suggestion-text">${e.text}</p>` : t}
48
+ renderSuggestion(t, r) {
49
+ let i = e`
50
+ ${t.title ? e`<h3 class="pkt-searchinput__suggestion-title">${t.title}</h3>` : n}
51
+ ${t.text ? e`<p class="pkt-searchinput__suggestion-text">${t.text}</p>` : n}
52
52
  `;
53
- return e.href ? i`<a
54
- href=${e.href}
53
+ return t.href ? e`<a
54
+ href=${t.href}
55
55
  class="pkt-searchinput__suggestion"
56
- @click=${(t) => this.onSuggestionClick(t, e, n)}
56
+ @click=${(e) => this.onSuggestionClick(e, t, r)}
57
57
  >
58
- ${r}
59
- </a>` : e.nonInteractive ? i`<div class="pkt-searchinput__suggestion">${r}</div>` : i`<button
58
+ ${i}
59
+ </a>` : t.nonInteractive ? e`<div class="pkt-searchinput__suggestion">${i}</div>` : e`<button
60
60
  type="button"
61
61
  class="pkt-searchinput__suggestion"
62
- @click=${(t) => this.onSuggestionClick(t, e, n)}
62
+ @click=${(e) => this.onSuggestionClick(e, t, r)}
63
63
  >
64
- ${r}
64
+ ${i}
65
65
  </button>`;
66
66
  }
67
67
  render() {
68
- let e = s({
68
+ let t = this.pktStrings.get("searchinput"), r = s({
69
69
  "pkt-searchinput": !0,
70
70
  [`pkt-searchinput--${this.appearance}`]: !0,
71
71
  [`pkt-searchinput--${this.inputSize}`]: !0,
72
72
  "pkt-searchinput--fullwidth": this.fullwidth
73
- }), n = s({
73
+ }), i = s({
74
74
  "pkt-searchinput__button": !0,
75
75
  "pkt-input-icon": this.appearance === "local",
76
76
  "pkt-btn": !0,
@@ -79,73 +79,73 @@ var u = class extends o {
79
79
  "pkt-btn--tertiary": this.appearance === "local",
80
80
  "pkt-btn--primary": this.appearance === "global" || this.appearance === "local-with-button",
81
81
  "pkt-btn--yellow": this.appearance === "global"
82
- }), r = s({
82
+ }), a = s({
83
83
  "pkt-input": !0,
84
84
  [`pkt-input--${this.inputSize}`]: !0,
85
85
  "pkt-input--fullwidth": this.fullwidth
86
- }), a = this.appearance === "local" ? `pkt-input__container pkt-input__container--${this.inputSize}` : "pkt-searchinput__field", o = i`
87
- ${this.label ? i`<label for=${c(this.id || void 0)} class="pkt-inputwrapper__label"
86
+ }), o = this.appearance === "local" ? `pkt-input__container pkt-input__container--${this.inputSize}` : "pkt-searchinput__field", l = e`
87
+ ${this.label ? e`<label for=${c(this.id || void 0)} class="pkt-inputwrapper__label"
88
88
  >${this.label}</label
89
- >` : t}
90
- <div class=${a}>
89
+ >` : n}
90
+ <div class=${o}>
91
91
  <input
92
- class=${r}
92
+ class=${a}
93
93
  type="search"
94
94
  name=${this.name || this.id}
95
95
  id=${this.id}
96
- placeholder=${this.placeholder || "Søk…"}
96
+ placeholder=${this.placeholder || t.placeholder}
97
97
  .value=${this.value}
98
98
  ?disabled=${this.disabled}
99
99
  autocomplete="off"
100
100
  aria-label=${c(this.inputAriaLabel)}
101
- aria-autocomplete=${this.suggestions ? "list" : t}
102
- aria-controls=${this.suggestions ? this.suggestionsId : t}
101
+ aria-autocomplete=${this.suggestions ? "list" : n}
102
+ aria-controls=${this.suggestions ? this.suggestionsId : n}
103
103
  @input=${this.onInput}
104
104
  @keydown=${this.onInputKeydown}
105
105
  />
106
106
  <button
107
107
  type="submit"
108
- class=${n}
108
+ class=${i}
109
109
  ?disabled=${this.disabled}
110
110
  @click=${this.onSearchClick}
111
111
  >
112
112
  <pkt-icon class="pkt-btn__icon" name="magnifying-glass-big"></pkt-icon>
113
- <span class="pkt-btn__text">${this.label || this.placeholder || "Søk…"}</span>
113
+ <span class="pkt-btn__text">${this.label || this.placeholder || t.placeholder}</span>
114
114
  </button>
115
115
  </div>
116
- ${this.suggestions ? i`<ul
116
+ ${this.suggestions ? e`<ul
117
117
  id=${this.suggestionsId}
118
118
  class="pkt-searchinput__suggestions"
119
119
  aria-live="assertive"
120
120
  >
121
- ${this.suggestions.map((e, t) => i` <li>${this.renderSuggestion(e, t)}</li> `)}
122
- </ul>` : t}
121
+ ${this.suggestions.map((t, n) => e` <li>${this.renderSuggestion(t, n)}</li> `)}
122
+ </ul>` : n}
123
123
  `;
124
- return this.action ? i`<form
124
+ return this.action ? e`<form
125
125
  role="search"
126
- class=${e}
126
+ class=${r}
127
127
  action=${this.action}
128
128
  method=${c(this.method)}
129
129
  >
130
- ${o}
131
- </form>` : i`<div role="search" class=${e}>${o}</div>`;
130
+ ${l}
131
+ </form>` : e`<div role="search" class=${r}>${l}</div>`;
132
132
  }
133
133
  };
134
- n([r({ type: String })], u.prototype, "appearance", void 0), n([r({
134
+ i([o({ type: String })], u.prototype, "appearance", void 0), i([o({
135
135
  type: String,
136
136
  attribute: "input-size"
137
- })], u.prototype, "inputSize", void 0), n([r({
137
+ })], u.prototype, "inputSize", void 0), i([o({
138
138
  type: Boolean,
139
139
  reflect: !0
140
- })], u.prototype, "disabled", void 0), n([r({
140
+ })], u.prototype, "disabled", void 0), i([o({
141
141
  type: Boolean,
142
142
  reflect: !0
143
- })], u.prototype, "fullwidth", void 0), n([r({
143
+ })], u.prototype, "fullwidth", void 0), i([o({
144
144
  type: String,
145
145
  reflect: !0
146
- })], u.prototype, "id", void 0), n([r({ type: String })], u.prototype, "label", void 0), n([r({ type: String })], u.prototype, "name", void 0), n([r({ type: String })], u.prototype, "placeholder", void 0), n([r({ type: String })], u.prototype, "value", void 0), n([r({ type: Array })], u.prototype, "suggestions", void 0), n([r({ type: String })], u.prototype, "action", void 0), n([r({ type: String })], u.prototype, "method", void 0), n([e()], u.prototype, "inputAriaLabel", void 0);
146
+ })], u.prototype, "id", void 0), i([o({ type: String })], u.prototype, "label", void 0), i([o({ type: String })], u.prototype, "name", void 0), i([o({ type: String })], u.prototype, "placeholder", void 0), i([o({ type: String })], u.prototype, "value", void 0), i([o({ type: Array })], u.prototype, "suggestions", void 0), i([o({ type: String })], u.prototype, "action", void 0), i([o({ type: String })], u.prototype, "method", void 0), i([r()], u.prototype, "inputAriaLabel", void 0);
147
147
  try {
148
- a("pkt-searchinput")(u);
148
+ t("pkt-searchinput")(u);
149
149
  } catch {
150
150
  console.warn("Forsøker å definere <pkt-searchinput>, men den er allerede definert");
151
151
  }
@@ -1,5 +1,6 @@
1
- const e=require("./element-BA8v6S7z.cjs"),t=require("./element-with-slot-Bj7nm7fO.cjs"),n=require("./if-defined-B89_ZeCj.cjs"),r=require("./ref-CQoEIIp0.cjs"),i=require("./input-element-DYmQw-fH.cjs"),a=require("./pkt-options-controller-C5EBX2T0.cjs"),o=require("./input-wrapper-Q-B-aBeb.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.o({type:Array,attribute:`options`})],s.prototype,`_optionsProp`,void 0),e.n([e.a()],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.p`
1
+ const e=require("./element-B8OGznK0.cjs"),t=require("./element-with-slot-DTxILHVv.cjs"),n=require("./if-defined-CVYApOgK.cjs"),r=require("./ref-CHbJYtKE.cjs"),i=require("./input-element-DumGj_oJ.cjs"),a=require("./pkt-options-controller-CEEAqXaB.cjs"),o=require("./input-wrapper-DDfapoRX.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
+ .strings=${this.strings}
3
4
  .size=${this.inputSize}
4
5
  ?disabled=${this.disabled}
5
6
  ?hasError=${this.hasError}
@@ -35,7 +36,7 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./element-with-slot-Bj7nm7f
35
36
  @blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
36
37
  ${r.n(this.inputRef)}
37
38
  >
38
- ${this._options.length>0?this._options.map(t=>e.p`<option
39
+ ${this._options.length>0?this._options.map(t=>e._`<option
39
40
  value=${t.value}
40
41
  ?selected=${this.value==t.value||t.selected}
41
42
  ?disabled=${t.disabled}
@@ -46,4 +47,4 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./element-with-slot-Bj7nm7f
46
47
  </select>
47
48
  <div class="pkt-contents" slot="helptext">${t.n(this,`helptext`)}</div>
48
49
  </pkt-input-wrapper>
49
- `}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};e.n([e.o({type:String})],c.prototype,`value`,void 0);try{e.s(`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}});
50
+ `}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
- import { a as e, n as t, o as n, p as r, s as i } from "./element-ChsFgr_B.js";
2
- import { n as a } from "./element-with-slot-BvG9ctC-.js";
3
- import { t as o } from "./if-defined-CGzIlZ9-.js";
4
- import { n as s, t as c } from "./ref-CWD6PjVd.js";
5
- import { t as l } from "./input-element-DBMNBplu.js";
6
- import { t as u } from "./pkt-options-controller-B77vH3PE.js";
7
- import { r as d } from "./input-wrapper-BmxNvznr.js";
1
+ import { _ as e, d as t, l as n, n as r, u as i } from "./element-BKSPVgs2.js";
2
+ import { n as a } from "./element-with-slot-YUAUFRqw.js";
3
+ import { t as o } from "./if-defined-BF8XcDi5.js";
4
+ import { n as s, t as c } from "./ref-Chc_DZAb.js";
5
+ import { t as l } from "./input-element-D07DmR34.js";
6
+ import { t as u } from "./pkt-options-controller-PtjhmTGk.js";
7
+ import { r as d } from "./input-wrapper-Cci_wTvD.js";
8
8
  //#region src/base-elements/options-input-element.ts
9
9
  var f = class extends l {
10
10
  constructor(...e) {
@@ -36,10 +36,10 @@ var f = class extends l {
36
36
  super.willUpdate(e), this.parseOptions();
37
37
  }
38
38
  };
39
- t([n({
39
+ r([i({
40
40
  type: Array,
41
41
  attribute: "options"
42
- })], f.prototype, "_optionsProp", void 0), t([e()], f.prototype, "_options", void 0);
42
+ })], f.prototype, "_optionsProp", void 0), r([n()], f.prototype, "_options", void 0);
43
43
  //#endregion
44
44
  //#region src/components/select/select.ts
45
45
  var p = class extends f {
@@ -88,9 +88,10 @@ var p = class extends f {
88
88
  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;
89
89
  }
90
90
  render() {
91
- let e = `pkt-input pkt-input--${this.inputSize} ${this.fullwidth ? "pkt-input--fullwidth" : ""}`;
92
- return r`
91
+ let t = `pkt-input pkt-input--${this.inputSize} ${this.fullwidth ? "pkt-input--fullwidth" : ""}`;
92
+ return e`
93
93
  <pkt-input-wrapper
94
+ .strings=${this.strings}
94
95
  .size=${this.inputSize}
95
96
  ?disabled=${this.disabled}
96
97
  ?hasError=${this.hasError}
@@ -111,7 +112,7 @@ var p = class extends f {
111
112
  tagText=${o(this.tagText)}
112
113
  >
113
114
  <select
114
- class=${e}
115
+ class=${t}
115
116
  aria-invalid=${this.hasError}
116
117
  aria-errormessage=${o(this.hasError ? `${this.id}-input-error` : void 0)}
117
118
  aria-describedby=${o(d({
@@ -139,13 +140,13 @@ var p = class extends f {
139
140
  }}
140
141
  ${s(this.inputRef)}
141
142
  >
142
- ${this._options.length > 0 ? this._options.map((e) => r`<option
143
- value=${e.value}
144
- ?selected=${this.value == e.value || e.selected}
145
- ?disabled=${e.disabled}
146
- ?hidden=${e.hidden}
143
+ ${this._options.length > 0 ? this._options.map((t) => e`<option
144
+ value=${t.value}
145
+ ?selected=${this.value == t.value || t.selected}
146
+ ?disabled=${t.disabled}
147
+ ?hidden=${t.hidden}
147
148
  >
148
- ${e.label}
149
+ ${t.label}
149
150
  </option>`) : ""}
150
151
  </select>
151
152
  <div class="pkt-contents" slot="helptext">${a(this, "helptext")}</div>
@@ -156,9 +157,9 @@ var p = class extends f {
156
157
  return e == null || isNaN(e) ? null : e;
157
158
  }
158
159
  };
159
- t([n({ type: String })], p.prototype, "value", void 0);
160
+ r([i({ type: String })], p.prototype, "value", void 0);
160
161
  try {
161
- i("pkt-select")(p);
162
+ t("pkt-select")(p);
162
163
  } catch {
163
164
  console.warn("Forsøker å definere <pkt-select>, men den er allerede definert");
164
165
  }
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Tekster og informasjonskapsel-oppsett for samtykkedialogen.
3
+ *
4
+ * Denne ligger utenfor `nb.ts` fordi formen er en annen: en liste med
5
+ * informasjonskapsler som hver har egne tekster per språk, ikke et flatt
6
+ * namespace. Den deles av Elements og React slik at de to ikke kommer i utakt.
7
+ */
8
+ export declare const consentStrings: {
9
+ i18n: {
10
+ nb: {
11
+ contentPresentation: {
12
+ title: string;
13
+ description: string[];
14
+ buttons: {
15
+ accept: string;
16
+ reject: string;
17
+ settings: string;
18
+ };
19
+ };
20
+ contentSettings: {
21
+ title: string;
22
+ description: string[];
23
+ buttons: {
24
+ back: string;
25
+ save: string;
26
+ };
27
+ };
28
+ };
29
+ en: {
30
+ contentPresentation: {
31
+ title: string;
32
+ description: string[];
33
+ buttons: {
34
+ accept: string;
35
+ reject: string;
36
+ settings: string;
37
+ };
38
+ };
39
+ contentSettings: {
40
+ title: string;
41
+ description: string[];
42
+ buttons: {
43
+ back: string;
44
+ save: string;
45
+ };
46
+ };
47
+ };
48
+ };
49
+ cookies: {
50
+ name: string;
51
+ defaultValue: boolean;
52
+ i18n: {
53
+ nb: {
54
+ title: string;
55
+ description: string;
56
+ buttons: {
57
+ yes: string;
58
+ no: string;
59
+ };
60
+ };
61
+ en: {
62
+ title: string;
63
+ description: string;
64
+ buttons: {
65
+ yes: string;
66
+ no: string;
67
+ };
68
+ };
69
+ };
70
+ }[];
71
+ };
@@ -0,0 +1,21 @@
1
+ import type { TPktStringParams } from './types';
2
+ /**
3
+ * Setter verdier inn i `{navn}`-plassholdere.
4
+ *
5
+ * ```ts
6
+ * formatString('Verdien må være større enn eller lik {min}.', { min: 5 })
7
+ * // → 'Verdien må være større enn eller lik 5.'
8
+ * ```
9
+ *
10
+ * En plassholder uten tilsvarende verdi blir stående urørt, slik at en ufullstendig
11
+ * overstyring gir synlig, feilsøkbar tekst i stedet for et tomt felt.
12
+ */
13
+ export declare function formatString(template: string, params?: TPktStringParams): string;
14
+ /**
15
+ * Velger entalls- eller flertallsform.
16
+ *
17
+ * ```ts
18
+ * plural(count, s.fileLabelOne, s.fileLabelOther)
19
+ * ```
20
+ */
21
+ export declare function plural(count: number, one: string, other: string): string;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Delt tekstkatalog for Punkt.
3
+ *
4
+ * Alle UI-tekster i designsystemet defineres i `nb.ts` og brukes derfra av både
5
+ * `@oslokommune/punkt-elements` og `@oslokommune/punkt-react`. Konsumenter kan
6
+ * overstyre tekster globalt med `setPktStrings()` eller per komponentinstans via
7
+ * `strings`-propen.
8
+ */
9
+ export { nb } from './nb';
10
+ export { formatString, plural } from './format';
11
+ export { getPktStrings, resetPktStrings, setPktStrings, subscribePktStrings } from './store';
12
+ export { resolveNamespace, resolveStrings } from './resolve';
13
+ export type { TPktStringParams, TPktStrings, TPktStringsNamespace, TPktStringsOverride, TPktStringsShape, TPktStringValue, } from './types';
14
+ export { consentStrings } from './consent';
@@ -0,0 +1,118 @@
1
+ export declare const nb: {
2
+ /** Tekster som går igjen på tvers av flere komponenter. */
3
+ generic: {
4
+ from: string;
5
+ to: string;
6
+ close: string;
7
+ };
8
+ /** Etiketter og hjelpetekst rundt skjemafelt. */
9
+ forms: {
10
+ optional: string;
11
+ required: string;
12
+ readMore: string;
13
+ };
14
+ /** Valideringsmeldinger. Nøkkelnavnene følger `ValidityState` der det finnes et tilsvarende flagg. */
15
+ validation: {
16
+ valueMissing: string;
17
+ typeMismatch: string;
18
+ patternMismatch: string;
19
+ tooShort: string;
20
+ tooLong: string;
21
+ rangeUnderflow: string;
22
+ rangeOverflow: string;
23
+ rangeUnderflowMin: string;
24
+ rangeOverflowMax: string;
25
+ stepMismatch: string;
26
+ timeStepMismatch: string;
27
+ timeStepMismatchHour: string;
28
+ timeStepMismatchHalfHour: string;
29
+ dateUnderflow: string;
30
+ dateOverflow: string;
31
+ counterExceeded: string;
32
+ };
33
+ /** Måneds- og dagsnavn. Listene må ha henholdsvis 12 og 7 elementer. */
34
+ dates: {
35
+ month: string;
36
+ year: string;
37
+ week: string;
38
+ days: string[];
39
+ daysShort: string[];
40
+ months: string[];
41
+ monthsShort: string[];
42
+ };
43
+ calendar: {
44
+ prevMonth: string;
45
+ nextMonth: string;
46
+ };
47
+ datepicker: {
48
+ openPicker: string;
49
+ deleteDate: string;
50
+ };
51
+ timepicker: {
52
+ hours: string;
53
+ minutes: string;
54
+ openPicker: string;
55
+ prevTime: string;
56
+ nextTime: string;
57
+ selectTime: string;
58
+ };
59
+ searchinput: {
60
+ placeholder: string;
61
+ submit: string;
62
+ };
63
+ backlink: {
64
+ label: string;
65
+ };
66
+ breadcrumbs: {
67
+ ariaLabel: string;
68
+ };
69
+ tag: {
70
+ remove: string;
71
+ };
72
+ header: {
73
+ search: string;
74
+ menu: string;
75
+ openMenu: string;
76
+ openSearch: string;
77
+ };
78
+ listbox: {
79
+ searchLabel: string;
80
+ searchPlaceholder: string;
81
+ };
82
+ combobox: {
83
+ noResults: string;
84
+ maxSelected: string;
85
+ tooManySelected: string;
86
+ alreadySelected: string;
87
+ valueAdded: string;
88
+ noValidValue: string;
89
+ };
90
+ fileupload: {
91
+ dropZoneDragMultiple: string;
92
+ dropZoneDragSingle: string;
93
+ dropZoneDragMultipleThumbnail: string;
94
+ dropZoneDragSingleThumbnail: string;
95
+ dropZoneDragActiveMultiple: string;
96
+ dropZoneDragActiveSingle: string;
97
+ dropZoneDragActiveMultipleThumbnail: string;
98
+ dropZoneDragActiveSingleThumbnail: string;
99
+ dropZoneOpenFileDialogMultiple: string;
100
+ dropZoneOpenFileDialogSingle: string;
101
+ dropZoneOpenFileDialogMultipleThumbnail: string;
102
+ dropZoneOpenFileDialogSingleThumbnail: string;
103
+ supportedFormatsPrefix: string;
104
+ invalidFormat: string;
105
+ sizeTooLarge: string;
106
+ requiredMissing: string;
107
+ genericValidationRejection: string;
108
+ unknownFilename: string;
109
+ previewFallbackName: string;
110
+ previewImage: string;
111
+ fileLabelOne: string;
112
+ fileLabelOther: string;
113
+ srFileAdded: string;
114
+ srFilesAdded: string;
115
+ srFilesUploadedOfTotal: string;
116
+ srFilesFailedOfTotal: string;
117
+ };
118
+ };
@@ -0,0 +1,12 @@
1
+ import type { TPktStrings, TPktStringsNamespace, TPktStringsOverride } from './types';
2
+ /** Slår opp ett namespace. */
3
+ export declare function resolveNamespace<K extends TPktStringsNamespace>(ns: K, ...layers: Array<TPktStringsOverride | undefined>): TPktStrings[K];
4
+ /**
5
+ * Slår opp flere namespace på én gang.
6
+ *
7
+ * ```ts
8
+ * const s = resolveStrings(['forms', 'validation'], this.strings)
9
+ * s.forms.optional
10
+ * ```
11
+ */
12
+ export declare function resolveStrings<NS extends TPktStringsNamespace>(namespaces: readonly NS[], ...layers: Array<TPktStringsOverride | undefined>): Pick<TPktStrings, NS>;
@@ -0,0 +1,27 @@
1
+ import type { TPktStringsOverride } from './types';
2
+ /**
3
+ * Global tekstoverstyring. Tilstanden ligger på `globalThis` bak en
4
+ * `Symbol.for()`-nøkkel, slik at `punkt-react` og `punkt-elements` deler én og
5
+ * samme store på tvers av modulgrafer.
6
+ */
7
+ type TListener = () => void;
8
+ /**
9
+ * Overstyrer tekster for hele applikasjonen. Kall det én gang ved oppstart.
10
+ * Flere kall merges sammen, namespace for namespace.
11
+ *
12
+ * ```ts
13
+ * setPktStrings({ forms: { optional: 'Frivillig' } })
14
+ * ```
15
+ */
16
+ export declare function setPktStrings(overrides: TPktStringsOverride): void;
17
+ /**
18
+ * Gjeldende globale overstyringer. Identiteten endrer seg ved hvert
19
+ * `setPktStrings()`-kall, så den kan brukes direkte som snapshot i
20
+ * `useSyncExternalStore`.
21
+ */
22
+ export declare function getPktStrings(): TPktStringsOverride;
23
+ /** Nullstiller til de innebygde tekstene. Ment for tester. */
24
+ export declare function resetPktStrings(): void;
25
+ /** Abonnerer på endringer. Returnerer en funksjon som melder av. */
26
+ export declare function subscribePktStrings(listener: TListener): () => void;
27
+ export {};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Typene for tekstkatalogen. Katalogen er nøyaktig to nivåer dyp:
3
+ * namespace → nøkkel → string | string[].
4
+ */
5
+ import type { nb } from './nb';
6
+ /** En enkelt tekstverdi. Lister brukes for måneds- og dagsnavn. */
7
+ export type TPktStringValue = string | readonly string[];
8
+ /** Formen alle språkbundler må følge. */
9
+ export type TPktStringsShape = Record<string, Record<string, TPktStringValue>>;
10
+ /**
11
+ * Hele katalogen, utledet fra bokmålsbundelen slik at `nb.ts` er det eneste
12
+ * stedet en nøkkel defineres.
13
+ */
14
+ export type TPktStrings = typeof nb;
15
+ /** Navnet på et namespace i katalogen, f.eks. `'forms'` eller `'searchinput'`. */
16
+ export type TPktStringsNamespace = keyof TPktStrings;
17
+ /**
18
+ * Delvis overstyring av katalogen. Generisk over namespace slik at en komponent
19
+ * kan smalne typen til de namespacene den faktisk bruker:
20
+ *
21
+ * ```ts
22
+ * strings?: TPktStringsOverride<'forms' | 'validation' | 'searchinput'>
23
+ * ```
24
+ */
25
+ export type TPktStringsOverride<NS extends TPktStringsNamespace = TPktStringsNamespace> = {
26
+ [K in NS]?: Partial<TPktStrings[K]>;
27
+ };
28
+ /** Verdier som kan settes inn i en `{plassholder}`. */
29
+ export type TPktStringParams = Record<string, string | number>;
@@ -44,30 +44,3 @@ export interface IFilesChangedDetail {
44
44
  reason: TFilesChangedReason;
45
45
  changedFileIds?: string[];
46
46
  }
47
- /** Default Norwegian Bokmål strings used by both implementations. */
48
- export interface IFileUploadStrings {
49
- dropZoneDragMultiple: string;
50
- dropZoneDragSingle: string;
51
- dropZoneDragMultipleThumbnail: string;
52
- dropZoneDragSingleThumbnail: string;
53
- dropZoneDragActiveMultiple: string;
54
- dropZoneDragActiveSingle: string;
55
- dropZoneDragActiveMultipleThumbnail: string;
56
- dropZoneDragActiveSingleThumbnail: string;
57
- dropZoneOpenFileDialogMultiple: string;
58
- dropZoneOpenFileDialogSingle: string;
59
- dropZoneOpenFileDialogMultipleThumbnail: string;
60
- dropZoneOpenFileDialogSingleThumbnail: string;
61
- supportedFormatsPrefix: string;
62
- invalidFormatDefault: (formats: string) => string;
63
- sizeTooLargeDefault: (maxSize: string) => string;
64
- requiredMissing: string;
65
- genericValidationRejection: string;
66
- unknownFilename: string;
67
- fileLabel: (count: number) => string;
68
- srFileAdded: (filename: string) => string;
69
- srFilesAdded: (count: number) => string;
70
- srFilesUploadedOfTotal: (uploaded: number, total: number, label: string) => string;
71
- srFilesFailedOfTotal: (failed: number, total: number, label: string) => string;
72
- }
73
- export declare const defaultFileUploadStrings: IFileUploadStrings;
@@ -21,5 +21,4 @@ export type { TProgressbarRole, TProgressbarSkin, TProgressbarStatusPlacement, T
21
21
  export type { IPktComboboxOption, TPktComboboxTagSkin, TPktComboboxDisplayValue, TPktComboboxTagPlacement, } from './combobox';
22
22
  export type { IPktSelectOption, TSelectOption } from './select';
23
23
  export type { TPktSearchInputAppearance, TPktSearchInputMethod, IPktSearchInputSuggestion, IPktSearchInput, } from './searchinput';
24
- export type { TUploadStrategy as TFileUploadStrategy, TFileUploadItemRenderer, TFilesChangedReason, TFileValidator, TTransferProgress, IFileItem, IFileTransfer, IFileValidateDetail, ITransferCancelledDetail, IFilesChangedDetail, IFileUploadStrings, } from './fileupload';
25
- export { defaultFileUploadStrings } from './fileupload';
24
+ export type { TUploadStrategy as TFileUploadStrategy, TFileUploadItemRenderer, TFilesChangedReason, TFileValidator, TTransferProgress, IFileItem, IFileTransfer, IFileValidateDetail, ITransferCancelledDetail, IFilesChangedDetail, } from './fileupload';
@@ -8,3 +8,4 @@ export { isLetterOrSpace, createTypeaheadHandler, findTypeaheadOptionMatch } fro
8
8
  export { getInputKeyAction, isArrowToggleKey, getInputValueAction, checkForMatches, getSingleValueForInput, } from './input-utils';
9
9
  export type { TInputKeyAction, TFocusOutAction, IFocusOutResult, ICheckForMatchesResult, } from './input-utils';
10
10
  export { focusAndScrollIntoView, getOptionElements, focusNextOption, focusPreviousOption, focusFirstOption, focusLastOption, focusFirstOrSelectedOption, } from './keyboard-navigation';
11
+ export type { TComboboxMessageKey } from './messages';
@@ -1,3 +1,4 @@
1
+ import type { TComboboxMessageKey } from './messages';
1
2
  /**
2
3
  * Shared combobox input utility functions used by both Elements and React packages.
3
4
  * Covers keyboard actions, focus-out validation, match checking, and input display.
@@ -23,7 +24,7 @@ export interface IFocusOutResult {
23
24
  export declare const getInputValueAction: (inputValue: string, currentValues: string[], options: IPktComboboxOption[], allowUserInput: boolean, multiple: boolean) => IFocusOutResult;
24
25
  export interface ICheckForMatchesResult {
25
26
  addValueText: string | null;
26
- userInfoMessage: string;
27
+ userInfoMessage: TComboboxMessageKey;
27
28
  shouldRemoveValue: boolean;
28
29
  shouldResetInput: boolean;
29
30
  }