@oslokommune/punkt-elements 18.3.1 → 18.5.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 (154) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/{accordion-4eAsO-Sr.js → accordion-D814csFx.js} +6 -6
  3. package/dist/{accordion-DOa5vubf.cjs → accordion-E0-pLzBq.cjs} +6 -6
  4. package/dist/{alert-DKNJTlMQ.js → alert-DNZtr3gd.js} +39 -31
  5. package/dist/alert-DqM9l5as.cjs +40 -0
  6. package/dist/{backlink-CA5R69FX.cjs → backlink-DYO8qA9C.cjs} +1 -1
  7. package/dist/{button-Dqolsuwj.js → button-Drwt7Qe5.js} +29 -26
  8. package/dist/button-jJfzE9C7.cjs +32 -0
  9. package/dist/{card-DgRvtnnk.js → card-BhmJZOGh.js} +90 -70
  10. package/dist/card-D-1JMn_h.cjs +64 -0
  11. package/dist/{combobox-q8kzy-S_.js → combobox-BNstYIC5.js} +20 -20
  12. package/dist/{combobox-D3zyAi_o.cjs → combobox-CRdBlMz1.cjs} +17 -17
  13. package/dist/components/alert/alert.d.ts +2 -0
  14. package/dist/components/button/button.d.ts +4 -21
  15. package/dist/components/button/index.d.ts +1 -1
  16. package/dist/components/card/card.d.ts +12 -3
  17. package/dist/components/index.d.ts +1 -1
  18. package/dist/components/linkcard/linkcard.d.ts +1 -1
  19. package/dist/components/loader/loader.d.ts +2 -2
  20. package/dist/components/messagebox/messagebox.d.ts +1 -1
  21. package/dist/components/progressbar/progressbar.d.ts +2 -6
  22. package/dist/{consent-Cqetmc5Q.cjs → consent-DaOFbopy.cjs} +1 -1
  23. package/dist/{consent-Dkyp-UbI.js → consent-Yvw7gZI_.js} +1 -1
  24. package/dist/{datepicker-8KnaI9Xj.cjs → datepicker-DjvL_Nb8.cjs} +16 -16
  25. package/dist/{datepicker-9ulmApjN.js → datepicker-DzTdWHkX.js} +3 -3
  26. package/dist/docs/components/button.d.ts +0 -1
  27. package/dist/{fileupload-XQAilDRd.js → fileupload-B8Uhfx2d.js} +24 -24
  28. package/dist/{fileupload-EWBE4h3V.cjs → fileupload-BJVYPl8u.cjs} +15 -15
  29. package/dist/{footer-BpuYmm5V.cjs → footer-BGC5PkLa.cjs} +1 -1
  30. package/dist/{footer-BXmN43ol.js → footer-BPxKLaut.js} +2 -2
  31. package/dist/{header-BPQHiw4v.js → header-BPzlBRhY.js} +30 -30
  32. package/dist/{header-BQ32MqUl.cjs → header-CAqegPzW.cjs} +34 -34
  33. package/dist/{header-menu-DpQbRKcm.cjs → header-menu-DBy7Yrd_.cjs} +1 -1
  34. package/dist/{header-menu-Dgem4HO9.js → header-menu-DWiPoQ58.js} +1 -1
  35. package/dist/{helptext-Ds8Q9IGV.cjs → helptext-BwDhf6VB.cjs} +2 -2
  36. package/dist/{helptext-BzLJKMMO.js → helptext-mf-67-fv.js} +2 -2
  37. package/dist/{input-wrapper-DzEgz7nZ.js → input-wrapper-BetB7OLQ.js} +16 -15
  38. package/dist/{input-wrapper-B0eSdZs3.cjs → input-wrapper-CS0qrYcm.cjs} +8 -7
  39. package/dist/{link-CpwR3BLX.cjs → link-DXnoMJIo.cjs} +3 -3
  40. package/dist/{link-C9xAIILf.js → link-DkO7a3Fs.js} +3 -3
  41. package/dist/{linkcard-Bzv3CEw5.cjs → linkcard-2l6z1M2U.cjs} +3 -3
  42. package/dist/{linkcard-C6ljKc0B.js → linkcard-aVKL5JPP.js} +8 -8
  43. package/dist/{loader-D6dau_7w.js → loader-CRVUJ-HU.js} +1 -1
  44. package/dist/{loader-Bv-1vwju.cjs → loader-D23kzlaR.cjs} +1 -1
  45. package/dist/{messagebox-CmhjIh0n.js → messagebox-CqI6_Ah7.js} +2 -2
  46. package/dist/{messagebox-DNUfv2FN.cjs → messagebox-DP06cyqc.cjs} +1 -1
  47. package/dist/pkt-accordion.cjs +1 -1
  48. package/dist/pkt-accordion.js +1 -1
  49. package/dist/pkt-alert.cjs +1 -1
  50. package/dist/pkt-alert.js +1 -1
  51. package/dist/pkt-backlink.cjs +1 -1
  52. package/dist/pkt-backlink.js +1 -1
  53. package/dist/pkt-button.cjs +1 -1
  54. package/dist/pkt-button.js +1 -1
  55. package/dist/pkt-card.cjs +1 -1
  56. package/dist/pkt-card.js +1 -1
  57. package/dist/pkt-combobox.cjs +1 -1
  58. package/dist/pkt-combobox.js +1 -1
  59. package/dist/pkt-consent.cjs +1 -1
  60. package/dist/pkt-consent.js +1 -1
  61. package/dist/pkt-datepicker.cjs +1 -1
  62. package/dist/pkt-datepicker.js +1 -1
  63. package/dist/pkt-fileupload.cjs +1 -1
  64. package/dist/pkt-fileupload.js +1 -1
  65. package/dist/pkt-footer.cjs +1 -1
  66. package/dist/pkt-footer.js +1 -1
  67. package/dist/pkt-header-menu.cjs +1 -1
  68. package/dist/pkt-header-menu.js +1 -1
  69. package/dist/pkt-header.cjs +1 -1
  70. package/dist/pkt-header.js +1 -1
  71. package/dist/pkt-helptext.cjs +1 -1
  72. package/dist/pkt-helptext.js +1 -1
  73. package/dist/pkt-index.cjs +1 -1
  74. package/dist/pkt-index.js +31 -31
  75. package/dist/pkt-input-wrapper.cjs +1 -1
  76. package/dist/pkt-input-wrapper.js +1 -1
  77. package/dist/pkt-link.cjs +1 -1
  78. package/dist/pkt-link.js +1 -1
  79. package/dist/pkt-linkcard.cjs +1 -1
  80. package/dist/pkt-linkcard.js +1 -1
  81. package/dist/pkt-loader.cjs +1 -1
  82. package/dist/pkt-loader.js +1 -1
  83. package/dist/pkt-messagebox.cjs +1 -1
  84. package/dist/pkt-messagebox.js +1 -1
  85. package/dist/pkt-progressbar.cjs +1 -1
  86. package/dist/pkt-progressbar.js +1 -1
  87. package/dist/pkt-radiobutton.cjs +1 -1
  88. package/dist/pkt-radiobutton.js +1 -1
  89. package/dist/pkt-searchinput.cjs +1 -1
  90. package/dist/pkt-searchinput.js +1 -1
  91. package/dist/pkt-select.cjs +1 -1
  92. package/dist/pkt-select.js +1 -1
  93. package/dist/pkt-tabs.cjs +1 -1
  94. package/dist/pkt-tabs.js +1 -1
  95. package/dist/pkt-tag.cjs +1 -1
  96. package/dist/pkt-tag.js +1 -1
  97. package/dist/pkt-textarea.cjs +1 -1
  98. package/dist/pkt-textarea.js +1 -1
  99. package/dist/pkt-textinput.cjs +1 -1
  100. package/dist/pkt-textinput.js +1 -1
  101. package/dist/pkt-timepicker.cjs +1 -1
  102. package/dist/pkt-timepicker.js +1 -1
  103. package/dist/progressbar-BPHLC7ce.js +117 -0
  104. package/dist/progressbar-BpcsDCnG.cjs +31 -0
  105. package/dist/{radiobutton-B_j_nYCC.js → radiobutton-B2e9Vyp8.js} +0 -1
  106. package/dist/{radiobutton-DsL-FNDd.cjs → radiobutton-C3nmL9rA.cjs} +0 -1
  107. package/dist/{searchinput-Dm3T0tGS.cjs → searchinput-CiPB8xvh.cjs} +3 -2
  108. package/dist/{searchinput-D7Dd2W2z.js → searchinput-DrUcPajl.js} +14 -12
  109. package/dist/{select-BqAZsLKy.js → select-B7TvZGIL.js} +15 -16
  110. package/dist/{select-VqzZdE-T.cjs → select-qxjHJ8bu.cjs} +13 -14
  111. package/dist/shared-types/button.d.ts +45 -0
  112. package/dist/shared-types/index.d.ts +2 -0
  113. package/dist/{tabs-DPdDkHSk.js → tabs-C_tCCdBK.js} +18 -18
  114. package/dist/{tabs-nvIpMwHK.cjs → tabs-DBanbSG1.cjs} +15 -15
  115. package/dist/tag-BDlwKjgT.cjs +27 -0
  116. package/dist/{tag-DBCzfbPE.js → tag-CdiDs9zb.js} +10 -10
  117. package/dist/{textarea-D17CiySU.cjs → textarea-DgFwd2LY.cjs} +10 -10
  118. package/dist/{textarea-C0a-K05x.js → textarea-YL6JYsB5.js} +14 -14
  119. package/dist/{textinput-D0QasOZ9.cjs → textinput-CIxMtaIo.cjs} +10 -10
  120. package/dist/{textinput-DKl04Y3e.js → textinput-CrJYDOHb.js} +12 -12
  121. package/dist/{timepicker-DVvI4uEk.js → timepicker-BHWOqlr8.js} +11 -11
  122. package/dist/{timepicker-BcnFL6Bj.cjs → timepicker-avaMu1hN.cjs} +8 -8
  123. package/package.json +2 -2
  124. package/src/components/accordion/accordion.ts +2 -1
  125. package/src/components/alert/alert.test.ts +2 -1
  126. package/src/components/alert/alert.ts +21 -3
  127. package/src/components/button/button.test.ts +0 -3
  128. package/src/components/button/button.ts +57 -62
  129. package/src/components/button/index.ts +0 -2
  130. package/src/components/card/card.test.ts +7 -7
  131. package/src/components/card/card.ts +99 -80
  132. package/src/components/helptext/helptext.ts +2 -2
  133. package/src/components/index.ts +0 -2
  134. package/src/components/input-wrapper/input-wrapper.ts +1 -0
  135. package/src/components/link/link.ts +4 -2
  136. package/src/components/linkcard/linkcard.test.ts +3 -3
  137. package/src/components/linkcard/linkcard.ts +1 -1
  138. package/src/components/loader/loader.test.ts +1 -1
  139. package/src/components/loader/loader.ts +3 -3
  140. package/src/components/messagebox/messagebox.test.ts +1 -1
  141. package/src/components/messagebox/messagebox.ts +2 -2
  142. package/src/components/progressbar/progressbar.test.ts +10 -8
  143. package/src/components/progressbar/progressbar.ts +63 -84
  144. package/src/components/radiobutton/radiobutton.ts +0 -1
  145. package/src/components/searchinput/searchinput.ts +3 -1
  146. package/src/components/select/select.test.ts +2 -1
  147. package/src/components/select/select.ts +0 -1
  148. package/dist/alert-BlHM1zEi.cjs +0 -35
  149. package/dist/button-CVMhQT3X.cjs +0 -30
  150. package/dist/card-DMKvuvNv.cjs +0 -87
  151. package/dist/progressbar-Bk_RsEjW.js +0 -112
  152. package/dist/progressbar-T5_MpZGN.cjs +0 -17
  153. package/dist/tag-Bp9gJnYh.cjs +0 -27
  154. package/dist/{backlink-BYUtL8cO.js → backlink-BHtxOlTw.js} +1 -1
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textinput-D0QasOZ9.cjs");exports.PktTextinput=e.n,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textinput-CIxMtaIo.cjs");exports.PktTextinput=e.n,exports.default=e.t;
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./textinput-DKl04Y3e.js";
1
+ import { n as e, t } from "./textinput-CrJYDOHb.js";
2
2
  export { e as PktTextinput, t as default };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./timepicker-BcnFL6Bj.cjs");exports.PktTimepicker=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./timepicker-avaMu1hN.cjs");exports.PktTimepicker=e.t;
@@ -1,2 +1,2 @@
1
- import { t as e } from "./timepicker-DVvI4uEk.js";
1
+ import { t as e } from "./timepicker-BHWOqlr8.js";
2
2
  export { e as PktTimepicker };
@@ -0,0 +1,117 @@
1
+ import { _ as e, d as t, f as n, g as r, h as i, l as a, m as o, n as s, p as c, t as l, u } from "./element-e2MAMNEP.js";
2
+ import { t as d } from "./class-map-BL_YL_Ed.js";
3
+ import { t as f } from "./if-defined-r8tKY4tG.js";
4
+ import "./icon-jEFbKTB_.js";
5
+ import { n as p, t as m } from "./ref-lE1mGUOL.js";
6
+ import { n as h } from "./utils-BwF4QSrq.js";
7
+ //#region ../../node_modules/lit-html/directives/style-map.js
8
+ var g = "important", _ = " !" + g, v = n(class extends c {
9
+ constructor(e) {
10
+ if (super(e), e.type !== o.ATTRIBUTE || e.name !== "style" || e.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
11
+ }
12
+ render(e) {
13
+ return Object.keys(e).reduce((t, n) => {
14
+ let r = e[n];
15
+ return r == null ? t : t + `${n = n.includes("-") ? n : n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${r};`;
16
+ }, "");
17
+ }
18
+ update(e, [t]) {
19
+ let { style: n } = e.element;
20
+ if (this.ft === void 0) return this.ft = new Set(Object.keys(t)), this.render(t);
21
+ for (let e of this.ft) t[e] ?? (this.ft.delete(e), e.includes("-") ? n.removeProperty(e) : n[e] = null);
22
+ for (let e in t) {
23
+ let r = t[e];
24
+ if (r != null) {
25
+ this.ft.add(e);
26
+ let t = typeof r == "string" && r.endsWith(_);
27
+ e.includes("-") || t ? n.setProperty(e, t ? r.slice(0, -11) : r, t ? g : "") : n[e] = r;
28
+ }
29
+ }
30
+ return r;
31
+ }
32
+ }), y = class extends l {
33
+ constructor() {
34
+ super(), this.ariaLabel = null, this.ariaLabelledby = null, this.ariaValueText = null, this.ariaLive = "polite", this.id = h(), this.role = "progressbar", this.skin = "dark-blue", this.statusPlacement = "following", this.statusType = "none", this.title = "", this.titlePosition = "left", this.valueCurrent = 0, this.valueMax = 100, this.valueMin = 0, this.labelWidth = 0, this.progressbarId = this.id, this.resolvedRole = "progressbar", this.labelRef = m(), this.progressBarRef = m();
35
+ }
36
+ willUpdate(e) {
37
+ super.willUpdate(e), this.hasAttribute("id") ? (this.progressbarId = this.getAttribute("id") || this.progressbarId, this.removeAttribute("id")) : this.id && (this.progressbarId = this.id);
38
+ let t = this.getAttribute("role");
39
+ t ? (this.resolvedRole = t, this.removeAttribute("role")) : this.role && (this.resolvedRole = this.role);
40
+ }
41
+ updated(e) {
42
+ super.updated(e), e.has("valueCurrent") && this.labelRef.value && (this.labelWidth = this.labelRef.value.getBoundingClientRect().width || 0);
43
+ }
44
+ render() {
45
+ let t = this.statusType !== "none", n = this.valueMax - this.valueMin, r = this.valueCurrent / n * 100, a = this.statusType === "fraction" ? Math.round(r) : Math.round((this.valueCurrent - this.valueMin) / (this.valueMax - this.valueMin) * 100), o = `${this.valueCurrent} av ${n}`, s = this.statusType === "fraction" && !this.ariaValueText ? `${this.valueCurrent} av ${this.valueMax - this.valueMin}` : this.ariaValueText || "", c = this.ariaLabel ? void 0 : this.ariaLabelledby || `${this.progressbarId}-title`, l = d({
46
+ "pkt-progressbar__bar": !0,
47
+ [`pkt-progressbar__bar--${this.skin}`]: !!this.skin
48
+ }), u = d({
49
+ "pkt-progressbar__title": !0,
50
+ "pkt-progressbar__title-center": this.titlePosition === "center"
51
+ }), m = d({
52
+ "pkt-progressbar__status": !0,
53
+ "pkt-progressbar__status--center": this.statusPlacement === "center"
54
+ }), h = d({
55
+ "pkt-progressbar__status-placement--following": this.statusPlacement === "following",
56
+ "pkt-progressbar__status-placement--center": this.statusPlacement === "center",
57
+ "pkt-progressbar__status-placement--left": this.statusPlacement === "left"
58
+ });
59
+ return e`<div
60
+ ${p(this.progressBarRef)}
61
+ id=${this.progressbarId}
62
+ role=${this.resolvedRole}
63
+ aria-live=${f(this.ariaLive || void 0)}
64
+ aria-atomic="true"
65
+ aria-valuenow=${this.valueCurrent}
66
+ aria-valuemin=${this.valueMin}
67
+ aria-valuemax=${this.valueMax}
68
+ aria-valuetext=${f(s || void 0)}
69
+ aria-label=${f(this.ariaLabel || void 0)}
70
+ aria-labelledby=${f(c)}
71
+ class="pkt-progressbar"
72
+ >
73
+ <div
74
+ class="pkt-progressbar__container"
75
+ style=${v({
76
+ "--pkt-progress-label-width": `${this.labelWidth}px`,
77
+ "--pkt-progress-width": `${a}%`
78
+ })}
79
+ >
80
+ ${this.title ? e`<p id=${`${this.progressbarId}-title`} class=${u}>${this.title}</p>` : i}
81
+
82
+ <div class="pkt-progressbar__bar-wrapper">
83
+ <div class=${l}></div>
84
+ </div>
85
+
86
+ ${t ? e`<div class=${m}>
87
+ <span class=${h} ${p(this.labelRef)}>
88
+ ${this.statusType === "percentage" ? `${a}%` : o}
89
+ </span>
90
+ </div>` : i}
91
+ </div>
92
+ </div>`;
93
+ }
94
+ };
95
+ s([u({ type: String })], y.prototype, "ariaLabel", void 0), s([u({
96
+ type: String,
97
+ reflect: !0
98
+ })], y.prototype, "ariaLabelledby", void 0), s([u({
99
+ type: String,
100
+ reflect: !0
101
+ })], y.prototype, "ariaValueText", void 0), s([u({ type: String })], y.prototype, "ariaLive", void 0), s([u({ type: String })], y.prototype, "id", void 0), s([u({ type: String })], y.prototype, "role", void 0), s([u({ type: String })], y.prototype, "skin", void 0), s([u({ type: String })], y.prototype, "statusPlacement", void 0), s([u({ type: String })], y.prototype, "statusType", void 0), s([u({
102
+ type: String,
103
+ reflect: !0
104
+ })], y.prototype, "title", void 0), s([u({ type: String })], y.prototype, "titlePosition", void 0), s([u({
105
+ type: Number,
106
+ reflect: !0
107
+ })], y.prototype, "valueCurrent", void 0), s([u({ type: Number })], y.prototype, "valueMax", void 0), s([u({ type: Number })], y.prototype, "valueMin", void 0), s([a()], y.prototype, "labelWidth", void 0), s([a()], y.prototype, "progressbarId", void 0), s([a()], y.prototype, "resolvedRole", void 0);
108
+ try {
109
+ t("pkt-progressbar")(y);
110
+ } catch {
111
+ console.warn("Forsøker å definere <pkt-progressbar>, men den er allerede definert");
112
+ }
113
+ //#endregion
114
+ //#region src/components/progressbar/index.ts
115
+ var b = y;
116
+ //#endregion
117
+ export { y as n, b as t };
@@ -0,0 +1,31 @@
1
+ const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),n=require("./if-defined-BeVQnl3C.cjs");require("./icon-DBFTFd-J.cjs");const r=require("./ref-BkV4Cd8U.cjs"),i=require("./utils-63cRpWut.cjs");var a=`important`,o=` !`+a,s=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.ATTRIBUTE||t.name!==`style`||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r==null?t:t+`${n=n.includes(`-`)?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,`-$&`).toLowerCase()}:${r};`},``)}update(t,[n]){let{style:r}=t.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(let e of this.ft)n[e]??(this.ft.delete(e),e.includes(`-`)?r.removeProperty(e):r[e]=null);for(let e in n){let t=n[e];if(t!=null){this.ft.add(e);let n=typeof t==`string`&&t.endsWith(o);e.includes(`-`)||n?r.setProperty(e,n?t.slice(0,-11):t,n?a:``):r[e]=t}}return e.g}}),c=class extends e.t{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive=`polite`,this.id=i.n(),this.role=`progressbar`,this.skin=`dark-blue`,this.statusPlacement=`following`,this.statusType=`none`,this.title=``,this.titlePosition=`left`,this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.labelWidth=0,this.progressbarId=this.id,this.resolvedRole=`progressbar`,this.labelRef=r.t(),this.progressBarRef=r.t()}willUpdate(e){super.willUpdate(e),this.hasAttribute(`id`)?(this.progressbarId=this.getAttribute(`id`)||this.progressbarId,this.removeAttribute(`id`)):this.id&&(this.progressbarId=this.id);let t=this.getAttribute(`role`);t?(this.resolvedRole=t,this.removeAttribute(`role`)):this.role&&(this.resolvedRole=this.role)}updated(e){super.updated(e),e.has(`valueCurrent`)&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0)}render(){let i=this.statusType!==`none`,a=this.valueMax-this.valueMin,o=this.valueCurrent/a*100,c=this.statusType===`fraction`?Math.round(o):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),l=`${this.valueCurrent} av ${a}`,u=this.statusType===`fraction`&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||``,d=this.ariaLabel?void 0:this.ariaLabelledby||`${this.progressbarId}-title`,f=t.t({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),p=t.t({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition===`center`}),m=t.t({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement===`center`}),h=t.t({"pkt-progressbar__status-placement--following":this.statusPlacement===`following`,"pkt-progressbar__status-placement--center":this.statusPlacement===`center`,"pkt-progressbar__status-placement--left":this.statusPlacement===`left`});return e._`<div
2
+ ${r.n(this.progressBarRef)}
3
+ id=${this.progressbarId}
4
+ role=${this.resolvedRole}
5
+ aria-live=${n.t(this.ariaLive||void 0)}
6
+ aria-atomic="true"
7
+ aria-valuenow=${this.valueCurrent}
8
+ aria-valuemin=${this.valueMin}
9
+ aria-valuemax=${this.valueMax}
10
+ aria-valuetext=${n.t(u||void 0)}
11
+ aria-label=${n.t(this.ariaLabel||void 0)}
12
+ aria-labelledby=${n.t(d)}
13
+ class="pkt-progressbar"
14
+ >
15
+ <div
16
+ class="pkt-progressbar__container"
17
+ style=${s({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${c}%`})}
18
+ >
19
+ ${this.title?e._`<p id=${`${this.progressbarId}-title`} class=${p}>${this.title}</p>`:e.h}
20
+
21
+ <div class="pkt-progressbar__bar-wrapper">
22
+ <div class=${f}></div>
23
+ </div>
24
+
25
+ ${i?e._`<div class=${m}>
26
+ <span class=${h} ${r.n(this.labelRef)}>
27
+ ${this.statusType===`percentage`?`${c}%`:l}
28
+ </span>
29
+ </div>`:e.h}
30
+ </div>
31
+ </div>`}};e.n([e.u({type:String})],c.prototype,`ariaLabel`,void 0),e.n([e.u({type:String,reflect:!0})],c.prototype,`ariaLabelledby`,void 0),e.n([e.u({type:String,reflect:!0})],c.prototype,`ariaValueText`,void 0),e.n([e.u({type:String})],c.prototype,`ariaLive`,void 0),e.n([e.u({type:String})],c.prototype,`id`,void 0),e.n([e.u({type:String})],c.prototype,`role`,void 0),e.n([e.u({type:String})],c.prototype,`skin`,void 0),e.n([e.u({type:String})],c.prototype,`statusPlacement`,void 0),e.n([e.u({type:String})],c.prototype,`statusType`,void 0),e.n([e.u({type:String,reflect:!0})],c.prototype,`title`,void 0),e.n([e.u({type:String})],c.prototype,`titlePosition`,void 0),e.n([e.u({type:Number,reflect:!0})],c.prototype,`valueCurrent`,void 0),e.n([e.u({type:Number})],c.prototype,`valueMax`,void 0),e.n([e.u({type:Number})],c.prototype,`valueMin`,void 0),e.n([e.l()],c.prototype,`labelWidth`,void 0),e.n([e.l()],c.prototype,`progressbarId`,void 0),e.n([e.l()],c.prototype,`resolvedRole`,void 0);try{e.d(`pkt-progressbar`)(c)}catch{console.warn(`Forsøker å definere <pkt-progressbar>, men den er allerede definert`)}var l=c;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
@@ -33,7 +33,6 @@ var u = class extends l {
33
33
  id=${this.id + "-internal"}
34
34
  class=${r}
35
35
  type="radio"
36
- role="radio"
37
36
  ?disabled=${this.disabled}
38
37
  form=""
39
38
  name=${this.name + "-internal"}
@@ -5,7 +5,6 @@ const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),
5
5
  id=${this.id+`-internal`}
6
6
  class=${i}
7
7
  type="radio"
8
- role="radio"
9
8
  ?disabled=${this.disabled}
10
9
  form=""
11
10
  name=${this.name+`-internal`}
@@ -1,4 +1,4 @@
1
- const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs");require("./icon-DBFTFd-J.cjs");const n=require("./if-defined-BeVQnl3C.cjs"),r=require("./focus-modality-controller-C1ocyv2J.cjs");var i=class extends e.t{constructor(...e){super(...e),this.appearance=`local`,this.inputSize=`medium`,this.disabled=!1,this.fullwidth=!1,this.id=``,this.value=``,this.focusModality=new r.t(this,`.pkt-searchinput`)}willUpdate(e){super.willUpdate(e);let t=this.getAttribute(`aria-label`);t&&(this.inputAriaLabel=t,this.removeAttribute(`aria-label`))}get suggestionsId(){return`${this.id}-suggestions`}dispatchSearch(){this.dispatchEvent(new CustomEvent(`pkt-search`,{detail:{value:this.value},bubbles:!0,composed:!0}))}onInput(e){let t=e.target;this.value=t.value}onInputKeydown(e){e.key===`Enter`&&(this.action||e.preventDefault(),this.dispatchSearch())}onSearchClick(e){this.action||e.preventDefault(),this.dispatchSearch()}onSuggestionClick(e,t,n){let r=new CustomEvent(`pkt-suggestion-click`,{detail:{index:n,suggestion:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}renderSuggestion(t,n){let r=e._`
1
+ const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),n=require("./if-defined-BeVQnl3C.cjs");require("./icon-DBFTFd-J.cjs");const r=require("./utils-63cRpWut.cjs"),i=require("./focus-modality-controller-C1ocyv2J.cjs");var a=class extends e.t{constructor(...e){super(...e),this.appearance=`local`,this.inputSize=`medium`,this.disabled=!1,this.fullwidth=!1,this.id=r.n(),this.value=``,this.focusModality=new i.t(this,`.pkt-searchinput`)}willUpdate(e){super.willUpdate(e);let t=this.getAttribute(`aria-label`);t&&(this.inputAriaLabel=t,this.removeAttribute(`aria-label`))}get suggestionsId(){return`${this.id}-suggestions`}dispatchSearch(){this.dispatchEvent(new CustomEvent(`pkt-search`,{detail:{value:this.value},bubbles:!0,composed:!0}))}onInput(e){let t=e.target;this.value=t.value}onInputKeydown(e){e.key===`Enter`&&(this.action||e.preventDefault(),this.dispatchSearch())}onSearchClick(e){this.action||e.preventDefault(),this.dispatchSearch()}onSuggestionClick(e,t,n){let r=new CustomEvent(`pkt-suggestion-click`,{detail:{index:n,suggestion:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}renderSuggestion(t,n){let r=e._`
2
2
  ${t.title?e._`<h3 class="pkt-searchinput__suggestion-title">${t.title}</h3>`:e.h}
3
3
  ${t.text?e._`<p class="pkt-searchinput__suggestion-text">${t.text}</p>`:e.h}
4
4
  `;return t.href?e._`<a
@@ -24,6 +24,7 @@ const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs");
24
24
  name=${this.name||this.id}
25
25
  id=${this.id}
26
26
  placeholder=${this.placeholder||r.placeholder}
27
+ value=${this.value}
27
28
  .value=${this.value}
28
29
  ?disabled=${this.disabled}
29
30
  autocomplete="off"
@@ -57,4 +58,4 @@ const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs");
57
58
  method=${n.t(this.method)}
58
59
  >
59
60
  ${c}
60
- </form>`:e._`<div role="search" class=${i}>${c}</div>`}};e.n([e.u({type:String})],i.prototype,`appearance`,void 0),e.n([e.u({type:String,attribute:`input-size`})],i.prototype,`inputSize`,void 0),e.n([e.u({type:Boolean,reflect:!0})],i.prototype,`disabled`,void 0),e.n([e.u({type:Boolean,reflect:!0})],i.prototype,`fullwidth`,void 0),e.n([e.u({type:String,reflect:!0})],i.prototype,`id`,void 0),e.n([e.u({type:String})],i.prototype,`label`,void 0),e.n([e.u({type:String})],i.prototype,`name`,void 0),e.n([e.u({type:String})],i.prototype,`placeholder`,void 0),e.n([e.u({type:String})],i.prototype,`value`,void 0),e.n([e.u({type:Array})],i.prototype,`suggestions`,void 0),e.n([e.u({type:String})],i.prototype,`action`,void 0),e.n([e.u({type:String})],i.prototype,`method`,void 0),e.n([e.l()],i.prototype,`inputAriaLabel`,void 0);try{e.d(`pkt-searchinput`)(i)}catch{console.warn(`Forsøker å definere <pkt-searchinput>, men den er allerede definert`)}var a=i;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
61
+ </form>`:e._`<div role="search" class=${i}>${c}</div>`}};e.n([e.u({type:String})],a.prototype,`appearance`,void 0),e.n([e.u({type:String,attribute:`input-size`})],a.prototype,`inputSize`,void 0),e.n([e.u({type:Boolean,reflect:!0})],a.prototype,`disabled`,void 0),e.n([e.u({type:Boolean,reflect:!0})],a.prototype,`fullwidth`,void 0),e.n([e.u({type:String,reflect:!0})],a.prototype,`id`,void 0),e.n([e.u({type:String})],a.prototype,`label`,void 0),e.n([e.u({type:String})],a.prototype,`name`,void 0),e.n([e.u({type:String})],a.prototype,`placeholder`,void 0),e.n([e.u({type:String})],a.prototype,`value`,void 0),e.n([e.u({type:Array})],a.prototype,`suggestions`,void 0),e.n([e.u({type:String})],a.prototype,`action`,void 0),e.n([e.u({type:String})],a.prototype,`method`,void 0),e.n([e.l()],a.prototype,`inputAriaLabel`,void 0);try{e.d(`pkt-searchinput`)(a)}catch{console.warn(`Forsøker å definere <pkt-searchinput>, men den er allerede definert`)}var o=a;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
@@ -1,12 +1,13 @@
1
1
  import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-e2MAMNEP.js";
2
2
  import { t as s } from "./class-map-BL_YL_Ed.js";
3
- import "./icon-jEFbKTB_.js";
4
3
  import { t as c } from "./if-defined-r8tKY4tG.js";
5
- import { t as l } from "./focus-modality-controller-Dc2S-KqR.js";
4
+ import "./icon-jEFbKTB_.js";
5
+ import { n as l } from "./utils-BwF4QSrq.js";
6
+ import { t as u } from "./focus-modality-controller-Dc2S-KqR.js";
6
7
  //#region src/components/searchinput/searchinput.ts
7
- var u = class extends a {
8
+ var d = class extends a {
8
9
  constructor(...e) {
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
+ super(...e), this.appearance = "local", this.inputSize = "medium", this.disabled = !1, this.fullwidth = !1, this.id = l(), this.value = "", this.focusModality = new u(this, ".pkt-searchinput");
10
11
  }
11
12
  willUpdate(e) {
12
13
  super.willUpdate(e);
@@ -94,6 +95,7 @@ var u = class extends a {
94
95
  name=${this.name || this.id}
95
96
  id=${this.id}
96
97
  placeholder=${this.placeholder || t.placeholder}
98
+ value=${this.value}
97
99
  .value=${this.value}
98
100
  ?disabled=${this.disabled}
99
101
  autocomplete="off"
@@ -131,26 +133,26 @@ var u = class extends a {
131
133
  </form>` : e`<div role="search" class=${r}>${l}</div>`;
132
134
  }
133
135
  };
134
- i([o({ type: String })], u.prototype, "appearance", void 0), i([o({
136
+ i([o({ type: String })], d.prototype, "appearance", void 0), i([o({
135
137
  type: String,
136
138
  attribute: "input-size"
137
- })], u.prototype, "inputSize", void 0), i([o({
139
+ })], d.prototype, "inputSize", void 0), i([o({
138
140
  type: Boolean,
139
141
  reflect: !0
140
- })], u.prototype, "disabled", void 0), i([o({
142
+ })], d.prototype, "disabled", void 0), i([o({
141
143
  type: Boolean,
142
144
  reflect: !0
143
- })], u.prototype, "fullwidth", void 0), i([o({
145
+ })], d.prototype, "fullwidth", void 0), i([o({
144
146
  type: String,
145
147
  reflect: !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);
148
+ })], d.prototype, "id", void 0), i([o({ type: String })], d.prototype, "label", void 0), i([o({ type: String })], d.prototype, "name", void 0), i([o({ type: String })], d.prototype, "placeholder", void 0), i([o({ type: String })], d.prototype, "value", void 0), i([o({ type: Array })], d.prototype, "suggestions", void 0), i([o({ type: String })], d.prototype, "action", void 0), i([o({ type: String })], d.prototype, "method", void 0), i([r()], d.prototype, "inputAriaLabel", void 0);
147
149
  try {
148
- t("pkt-searchinput")(u);
150
+ t("pkt-searchinput")(d);
149
151
  } catch {
150
152
  console.warn("Forsøker å definere <pkt-searchinput>, men den er allerede definert");
151
153
  }
152
154
  //#endregion
153
155
  //#region src/components/searchinput/index.ts
154
- var d = u;
156
+ var f = d;
155
157
  //#endregion
156
- export { u as n, d as t };
158
+ export { d as n, f as t };
@@ -1,10 +1,10 @@
1
1
  import { _ as e, d as t, l as n, n as r, u as i } from "./element-e2MAMNEP.js";
2
- import { n as a } from "./element-with-slot-COOwQUxM.js";
3
- import { t as o } from "./if-defined-r8tKY4tG.js";
2
+ import { t as a } from "./if-defined-r8tKY4tG.js";
3
+ import { n as o } from "./element-with-slot-COOwQUxM.js";
4
4
  import { n as s, t as c } from "./ref-lE1mGUOL.js";
5
5
  import { t as l } from "./input-element-DxHRTZ3K.js";
6
6
  import { t as u } from "./pkt-options-controller-DNDUGQno.js";
7
- import { r as d } from "./input-wrapper-DzEgz7nZ.js";
7
+ import { r as d } from "./input-wrapper-BetB7OLQ.js";
8
8
  //#region src/base-elements/options-input-element.ts
9
9
  var f = class extends l {
10
10
  constructor(...e) {
@@ -101,31 +101,30 @@ var p = class extends f {
101
101
  ?requiredTag=${this.requiredTag}
102
102
  useWrapper=${this.useWrapper}
103
103
  .ariaDescribedby=${this.ariaDescribedby}
104
- errorMessage=${o(this.errorMessage)}
104
+ errorMessage=${a(this.errorMessage)}
105
105
  forId=${this.id + "-input"}
106
- helptext=${o(this.helptext)}
107
- helptextDropdown=${o(this.helptextDropdown)}
108
- helptextDropdownButton=${o(this.helptextDropdownButton)}
109
- label=${o(this.label)}
110
- optionalText=${o(this.optionalText)}
111
- requiredText=${o(this.requiredText)}
112
- tagText=${o(this.tagText)}
106
+ helptext=${a(this.helptext)}
107
+ helptextDropdown=${a(this.helptextDropdown)}
108
+ helptextDropdownButton=${a(this.helptextDropdownButton)}
109
+ label=${a(this.label)}
110
+ optionalText=${a(this.optionalText)}
111
+ requiredText=${a(this.requiredText)}
112
+ tagText=${a(this.tagText)}
113
113
  >
114
114
  <select
115
115
  class=${t}
116
116
  aria-invalid=${this.hasError}
117
- aria-errormessage=${o(this.hasError ? `${this.id}-input-error` : void 0)}
118
- aria-describedby=${o(d({
117
+ aria-errormessage=${a(this.hasError ? `${this.id}-input-error` : void 0)}
118
+ aria-describedby=${a(d({
119
119
  id: this.id + "-input",
120
120
  hasHelptext: !!this.helptext,
121
121
  hasCounter: !1,
122
122
  ariaDescribedby: this.ariaDescribedby
123
123
  }))}
124
- aria-labelledby=${o(this.ariaLabelledby)}
124
+ aria-labelledby=${a(this.ariaLabelledby)}
125
125
  ?disabled=${this.disabled}
126
126
  id=${this.id + "-input"}
127
127
  name=${(this.name || this.id) + "-input"}
128
- value=${this.value}
129
128
  @change=${(e) => {
130
129
  this.touched = !0, this.value = e.target.value, e.stopImmediatePropagation();
131
130
  }}
@@ -149,7 +148,7 @@ var p = class extends f {
149
148
  ${t.label}
150
149
  </option>`) : ""}
151
150
  </select>
152
- <div class="pkt-contents" slot="helptext">${a(this, "helptext")}</div>
151
+ <div class="pkt-contents" slot="helptext">${o(this, "helptext")}</div>
153
152
  </pkt-input-wrapper>
154
153
  `;
155
154
  }
@@ -1,4 +1,4 @@
1
- const e=require("./element-DRc10X2R.cjs"),t=require("./element-with-slot-MkibfzHp.cjs"),n=require("./if-defined-BeVQnl3C.cjs"),r=require("./ref-BkV4Cd8U.cjs"),i=require("./input-element-KpXXnGi0.cjs"),a=require("./pkt-options-controller-CJPuBqvH.cjs"),o=require("./input-wrapper-B0eSdZs3.cjs");var s=class extends i.t{constructor(...e){super(...e),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate(`_optionsProp`,this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){let e=this._optionsProp.length>0,t=this.optionsController?.nodes?.length&&this.optionsController.nodes.length>0;e?this._options=this._optionsProp:t&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};e.n([e.u({type:Array,attribute:`options`})],s.prototype,`_optionsProp`,void 0),e.n([e.l()],s.prototype,`_options`,void 0);var c=class extends s{constructor(){super(),this.inputRef=r.t(),this.value=``,this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new a.t(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){let n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t==`number`)this._options.splice(t,0,n);else{let e=t.value||t.text,r=this._options.findIndex(t=>t.value===e);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(e=>e.value===this.value)),this.requestUpdate()}remove(e){typeof e==`number`&&(this.selectedIndex===e&&(this.value=this._options[0]?.value||``),this._options.splice(e,1),this.requestUpdate())}item(e){return this.inputRef.value?.item(e)}namedItem(e){return this.inputRef.value?.namedItem(e)}showPicker(){this.inputRef.value&&`showPicker`in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){e===`options`&&(this._options=n?JSON.parse(n):[]),e===`value`&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===n),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){super.update(e),e.has(`_optionsProp`)&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate(`_options`),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),e.has(`value`)&&this.value!==e.get(`value`)&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),this.classList.add(`pkt-select`),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions}render(){let i=`pkt-input pkt-input--${this.inputSize} ${this.fullwidth?`pkt-input--fullwidth`:``}`;return e._`
1
+ const e=require("./element-DRc10X2R.cjs"),t=require("./if-defined-BeVQnl3C.cjs"),n=require("./element-with-slot-MkibfzHp.cjs"),r=require("./ref-BkV4Cd8U.cjs"),i=require("./input-element-KpXXnGi0.cjs"),a=require("./pkt-options-controller-CJPuBqvH.cjs"),o=require("./input-wrapper-CS0qrYcm.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
3
  .strings=${this.strings}
4
4
  .size=${this.inputSize}
@@ -10,26 +10,25 @@ const e=require("./element-DRc10X2R.cjs"),t=require("./element-with-slot-MkibfzH
10
10
  ?requiredTag=${this.requiredTag}
11
11
  useWrapper=${this.useWrapper}
12
12
  .ariaDescribedby=${this.ariaDescribedby}
13
- errorMessage=${n.t(this.errorMessage)}
13
+ errorMessage=${t.t(this.errorMessage)}
14
14
  forId=${this.id+`-input`}
15
- helptext=${n.t(this.helptext)}
16
- helptextDropdown=${n.t(this.helptextDropdown)}
17
- helptextDropdownButton=${n.t(this.helptextDropdownButton)}
18
- label=${n.t(this.label)}
19
- optionalText=${n.t(this.optionalText)}
20
- requiredText=${n.t(this.requiredText)}
21
- tagText=${n.t(this.tagText)}
15
+ helptext=${t.t(this.helptext)}
16
+ helptextDropdown=${t.t(this.helptextDropdown)}
17
+ helptextDropdownButton=${t.t(this.helptextDropdownButton)}
18
+ label=${t.t(this.label)}
19
+ optionalText=${t.t(this.optionalText)}
20
+ requiredText=${t.t(this.requiredText)}
21
+ tagText=${t.t(this.tagText)}
22
22
  >
23
23
  <select
24
24
  class=${i}
25
25
  aria-invalid=${this.hasError}
26
- aria-errormessage=${n.t(this.hasError?`${this.id}-input-error`:void 0)}
27
- aria-describedby=${n.t(o.r({id:this.id+`-input`,hasHelptext:!!this.helptext,hasCounter:!1,ariaDescribedby:this.ariaDescribedby}))}
28
- aria-labelledby=${n.t(this.ariaLabelledby)}
26
+ aria-errormessage=${t.t(this.hasError?`${this.id}-input-error`:void 0)}
27
+ aria-describedby=${t.t(o.r({id:this.id+`-input`,hasHelptext:!!this.helptext,hasCounter:!1,ariaDescribedby:this.ariaDescribedby}))}
28
+ aria-labelledby=${t.t(this.ariaLabelledby)}
29
29
  ?disabled=${this.disabled}
30
30
  id=${this.id+`-input`}
31
31
  name=${(this.name||this.id)+`-input`}
32
- value=${this.value}
33
32
  @change=${e=>{this.touched=!0,this.value=e.target.value,e.stopImmediatePropagation()}}
34
33
  @input=${e=>{this.onInput(),e.stopImmediatePropagation()}}
35
34
  @focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
@@ -45,6 +44,6 @@ const e=require("./element-DRc10X2R.cjs"),t=require("./element-with-slot-MkibfzH
45
44
  ${t.label}
46
45
  </option>`):``}
47
46
  </select>
48
- <div class="pkt-contents" slot="helptext">${t.n(this,`helptext`)}</div>
47
+ <div class="pkt-contents" slot="helptext">${n.n(this,`helptext`)}</div>
49
48
  </pkt-input-wrapper>
50
49
  `}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};e.n([e.u({type:String})],c.prototype,`value`,void 0);try{e.d(`pkt-select`)(c)}catch{console.warn(`Forsøker å definere <pkt-select>, men den er allerede definert`)}var l=c;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
@@ -0,0 +1,45 @@
1
+ /**
2
+ * button.ts
3
+ *
4
+ * Type definitions for pkt-button.
5
+ * Used by React, Elements, and typed component specs.
6
+ */
7
+ import type { THTMLButtonType } from './form';
8
+ /** Button size variants — shared runtime source for types, specs, and Preview. */
9
+ export declare const BUTTON_SIZES: readonly ['xsmall', 'small', 'medium', 'large'];
10
+ export type TPktButtonSize = (typeof BUTTON_SIZES)[number];
11
+ /** Button skin variants — shared runtime source for types, specs, and Preview. */
12
+ export declare const BUTTON_SKINS: readonly ['primary', 'secondary', 'tertiary'];
13
+ export type TPktButtonSkin = (typeof BUTTON_SKINS)[number];
14
+ /** Button color overrides — shared runtime source for types, specs, and Preview. */
15
+ export declare const BUTTON_COLORS: readonly ['beige-dark-outline', 'beige-light', 'blue-outline', 'blue', 'green-dark-outline', 'green-dark', 'green-outline', 'green', 'red-outline', 'red', 'yellow-outline', 'yellow'];
16
+ export type TPktButtonColor = (typeof BUTTON_COLORS)[number];
17
+ /** Button content variants — shared runtime source for types, specs, and Preview. */
18
+ export declare const BUTTON_VARIANTS: readonly ['label-only', 'icon-left', 'icon-right', 'icon-only', 'icons-right-and-left'];
19
+ export type TPktButtonVariant = (typeof BUTTON_VARIANTS)[number];
20
+ /** Button preview states (docs only) — shared runtime source for types, specs, and Preview. */
21
+ export declare const BUTTON_STATES: readonly ['normal', 'focus', 'hover', 'active'];
22
+ export type TPktButtonState = (typeof BUTTON_STATES)[number];
23
+ /** Button props shared by React and Elements. */
24
+ export interface IPktButtonBase {
25
+ iconName?: string;
26
+ secondIconName?: string;
27
+ iconPath?: string;
28
+ secondIconPath?: string;
29
+ size?: TPktButtonSize;
30
+ fullWidth?: boolean;
31
+ fullWidthOnMobile?: boolean;
32
+ color?: TPktButtonColor;
33
+ skin?: TPktButtonSkin;
34
+ variant?: TPktButtonVariant;
35
+ state?: TPktButtonState;
36
+ type?: THTMLButtonType;
37
+ isLoading?: boolean;
38
+ disabled?: boolean;
39
+ loadingAnimationPath?: string;
40
+ }
41
+ /**
42
+ * Documented Button props (subset of `IPktButtonBase`).
43
+ * Used for typed component specs in documentation.
44
+ */
45
+ export type IButtonSpecProps = Pick<IPktButtonBase, 'size' | 'fullWidth' | 'fullWidthOnMobile' | 'skin' | 'type' | 'color' | 'state' | 'variant' | 'iconName' | 'secondIconName' | 'iconPath' | 'secondIconPath' | 'isLoading' | 'disabled'>;
@@ -14,6 +14,8 @@ export type { THTMLButtonType, TSelectionMode } from './form';
14
14
  export type { TPktInputSize, TSize3, TSize5, TSize7 } from './size';
15
15
  export { ACCORDION_SKINS } from './accordion';
16
16
  export type { TAccordionSkin, IPktAccordionBase, IPktAccordionItemBase, IAccordionSpecProps, IAccordionItemSpecProps, IAccordionVisualProps, } from './accordion';
17
+ export { BUTTON_SIZES, BUTTON_SKINS, BUTTON_COLORS, BUTTON_VARIANTS, BUTTON_STATES } from './button';
18
+ export type { TPktButtonSize, TPktButtonSkin, TPktButtonColor, TPktButtonVariant, TPktButtonState, IPktButtonBase, IButtonSpecProps, } from './button';
17
19
  export type { IPktBackLinkBase, IBacklinkSpecProps } from './backlink';
18
20
  export { LINKCARD_SKINS } from './linkcard';
19
21
  export type { TLinkCardSkin, IPktLinkCardBase, ILinkcardSpecProps } from './linkcard';
@@ -1,10 +1,10 @@
1
1
  import { _ as e, d as t, l as n, n as r, u as i } from "./element-e2MAMNEP.js";
2
- import { n as a, t as o } from "./element-with-slot-COOwQUxM.js";
3
- import { t as s } from "./if-defined-r8tKY4tG.js";
2
+ import { t as a } from "./if-defined-r8tKY4tG.js";
3
+ import { n as o, t as s } from "./element-with-slot-COOwQUxM.js";
4
4
  import { n as c, r as l, t as u } from "./consume-BDnMAp2g.js";
5
5
  import { n as d, t as f } from "./ref-lE1mGUOL.js";
6
6
  //#region src/components/tabs/tabs-context.ts
7
- var p = l(Symbol("pkt-tabs-context")), m = class extends o {
7
+ var p = l(Symbol("pkt-tabs-context")), m = class extends s {
8
8
  constructor(...e) {
9
9
  super(...e), this.arrowNav = !0, this.disableArrowNav = !1, this.separatorIconName = "", this.separatorIconPath = "", this.tabRefs = [], this.disabledMap = {}, this.tabCount = 0, this.context = {
10
10
  useArrowNav: this.useArrowNav,
@@ -78,7 +78,7 @@ var p = l(Symbol("pkt-tabs-context")), m = class extends o {
78
78
  let t = this.useArrowNav ? "tablist" : "navigation", n = this.separatorIconName || this.separatorIconPath ? "pkt-tabs pkt-tabs--with-separator" : "pkt-tabs";
79
79
  return e`
80
80
  <div class=${n}>
81
- <div class="pkt-tabs__list" role=${t}>${a(this)}</div>
81
+ <div class="pkt-tabs__list" role=${t}>${o(this)}</div>
82
82
  </div>
83
83
  `;
84
84
  }
@@ -107,7 +107,7 @@ try {
107
107
  }
108
108
  //#endregion
109
109
  //#region src/components/tabs/tabitem.ts
110
- var h = class extends o {
110
+ var h = class extends s {
111
111
  constructor() {
112
112
  super(), this.active = !1, this.disabled = !1, this.href = "", this.icon = "", this.controls = "", this.tag = "", this.tagSkin = "blue", this.index = 0, this.elementRef = f();
113
113
  }
@@ -134,21 +134,21 @@ var h = class extends o {
134
134
  this.context && this.context.handleKeyUp(e, this.index);
135
135
  }
136
136
  render() {
137
- let t = this.context?.useArrowNav ?? !0, n = this.active && !this.disabled, r = [n ? "active" : "", this.disabled ? "pkt-tabs__item--disabled" : ""].filter(Boolean).join(" "), i = t ? "tab" : void 0, o = t ? n : void 0, c = this.disabled ? -1 : n || !t ? void 0 : -1, l = `pkt-icon--small ${this.icon === "check" ? "pkt-tabs__status-icon" : ""}`, u = e`
137
+ let t = this.context?.useArrowNav ?? !0, n = this.active && !this.disabled, r = [n ? "active" : "", this.disabled ? "pkt-tabs__item--disabled" : ""].filter(Boolean).join(" "), i = t ? "tab" : void 0, s = t ? n : void 0, c = this.disabled ? -1 : n || !t ? void 0 : -1, l = `pkt-icon--small ${this.icon === "check" ? "pkt-tabs__status-icon" : ""}`, u = e`
138
138
  ${this.icon ? e`<pkt-icon name=${this.icon} class=${l}></pkt-icon>` : ""}
139
- <span>${a(this)}</span>
139
+ <span>${o(this)}</span>
140
140
  ${this.tag ? e`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>` : ""}
141
141
  `;
142
142
  return this.href ? e`
143
143
  <a
144
144
  ${d(this.elementRef)}
145
- href=${s(this.disabled ? void 0 : this.href)}
145
+ href=${a(this.disabled ? void 0 : this.href)}
146
146
  class="pkt-tabs__link ${r}"
147
- role=${s(i)}
148
- aria-selected=${s(o)}
149
- aria-disabled=${s(this.disabled ? "true" : void 0)}
150
- aria-controls=${s(this.controls || void 0)}
151
- tabindex=${s(c)}
147
+ role=${a(i)}
148
+ aria-selected=${a(s)}
149
+ aria-disabled=${a(this.disabled ? "true" : void 0)}
150
+ aria-controls=${a(this.controls || void 0)}
151
+ tabindex=${a(c)}
152
152
  @click=${this.handleClick}
153
153
  @keydown=${this.handleKeyDown}
154
154
  >
@@ -160,11 +160,11 @@ var h = class extends o {
160
160
  type="button"
161
161
  class="pkt-tabs__button pkt-link-button ${r}"
162
162
  ?disabled=${this.disabled}
163
- aria-disabled=${s(this.disabled ? "true" : void 0)}
164
- role=${s(i)}
165
- aria-selected=${s(o)}
166
- aria-controls=${s(this.controls || void 0)}
167
- tabindex=${s(c)}
163
+ aria-disabled=${a(this.disabled ? "true" : void 0)}
164
+ role=${a(i)}
165
+ aria-selected=${a(s)}
166
+ aria-controls=${a(this.controls || void 0)}
167
+ tabindex=${a(c)}
168
168
  @click=${this.handleClick}
169
169
  @keydown=${this.handleKeyDown}
170
170
  >
@@ -1,21 +1,21 @@
1
- const e=require("./element-DRc10X2R.cjs"),t=require("./element-with-slot-MkibfzHp.cjs"),n=require("./if-defined-BeVQnl3C.cjs"),r=require("./consume-Le4HztPo.cjs"),i=require("./ref-BkV4Cd8U.cjs");var a=r.r(Symbol(`pkt-tabs-context`)),o=class extends t.t{constructor(...e){super(...e),this.arrowNav=!0,this.disableArrowNav=!1,this.separatorIconName=``,this.separatorIconPath=``,this.tabRefs=[],this.disabledMap={},this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(e){(e.has(`arrowNav`)||e.has(`disableArrowNav`))&&(this.context={...this.context,useArrowNav:this.useArrowNav}),this.updateComplete.then(()=>this.syncSeparators())}syncSeparators(){let e=this.querySelector(`.pkt-tabs__list`);if(!e||(e.querySelectorAll(`.pkt-tabs__separator`).forEach(e=>e.remove()),!(this.separatorIconName||this.separatorIconPath)))return;let t=Array.from(e.children).filter(e=>!e.classList.contains(`pkt-tabs__separator`));for(let e=0;e<t.length-1;e++){let n=document.createElement(`span`);if(n.className=`pkt-tabs__separator`,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`role`,`presentation`),this.separatorIconPath){let e=document.createElement(`img`);e.setAttribute(`src`,this.separatorIconPath),e.setAttribute(`alt`,``),e.setAttribute(`aria-hidden`,`true`),n.appendChild(e)}else if(this.separatorIconName){let e=document.createElement(`pkt-icon`);e.setAttribute(`name`,this.separatorIconName),e.classList.add(`pkt-tabs__separator-icon`),n.appendChild(e)}t[e].after(n)}}registerTab(e,t,n=!1){this.tabRefs[t]=e,this.disabledMap[t]=n,this.tabCount=Math.max(this.tabCount,t+1)}isTabDisabled(e){return!!this.disabledMap[e]}findEnabledIndex(e,t){let n=e+t;for(;n>=0&&n<this.tabCount;){if(!this.isTabDisabled(n))return n;n+=t}return null}handleClick(e){this.isTabDisabled(e)||this.dispatchEvent(new CustomEvent(`tab-selected`,{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){if(this.useArrowNav){if(e.key===`ArrowLeft`){e.preventDefault();let n=this.findEnabledIndex(t,-1);n!==null&&this.tabRefs[n]?.focus()}if(e.key===`ArrowRight`){e.preventDefault();let n=this.findEnabledIndex(t,1);n!==null&&this.tabRefs[n]?.focus()}(e.key===`Enter`||e.key===` `||e.key===`Spacebar`||e.key===`ArrowDown`)&&(e.preventDefault(),this.handleClick(t))}}render(){let n=this.useArrowNav?`tablist`:`navigation`,r=this.separatorIconName||this.separatorIconPath?`pkt-tabs pkt-tabs--with-separator`:`pkt-tabs`;return e._`
1
+ const e=require("./element-DRc10X2R.cjs"),t=require("./if-defined-BeVQnl3C.cjs"),n=require("./element-with-slot-MkibfzHp.cjs"),r=require("./consume-Le4HztPo.cjs"),i=require("./ref-BkV4Cd8U.cjs");var a=r.r(Symbol(`pkt-tabs-context`)),o=class extends n.t{constructor(...e){super(...e),this.arrowNav=!0,this.disableArrowNav=!1,this.separatorIconName=``,this.separatorIconPath=``,this.tabRefs=[],this.disabledMap={},this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(e){(e.has(`arrowNav`)||e.has(`disableArrowNav`))&&(this.context={...this.context,useArrowNav:this.useArrowNav}),this.updateComplete.then(()=>this.syncSeparators())}syncSeparators(){let e=this.querySelector(`.pkt-tabs__list`);if(!e||(e.querySelectorAll(`.pkt-tabs__separator`).forEach(e=>e.remove()),!(this.separatorIconName||this.separatorIconPath)))return;let t=Array.from(e.children).filter(e=>!e.classList.contains(`pkt-tabs__separator`));for(let e=0;e<t.length-1;e++){let n=document.createElement(`span`);if(n.className=`pkt-tabs__separator`,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`role`,`presentation`),this.separatorIconPath){let e=document.createElement(`img`);e.setAttribute(`src`,this.separatorIconPath),e.setAttribute(`alt`,``),e.setAttribute(`aria-hidden`,`true`),n.appendChild(e)}else if(this.separatorIconName){let e=document.createElement(`pkt-icon`);e.setAttribute(`name`,this.separatorIconName),e.classList.add(`pkt-tabs__separator-icon`),n.appendChild(e)}t[e].after(n)}}registerTab(e,t,n=!1){this.tabRefs[t]=e,this.disabledMap[t]=n,this.tabCount=Math.max(this.tabCount,t+1)}isTabDisabled(e){return!!this.disabledMap[e]}findEnabledIndex(e,t){let n=e+t;for(;n>=0&&n<this.tabCount;){if(!this.isTabDisabled(n))return n;n+=t}return null}handleClick(e){this.isTabDisabled(e)||this.dispatchEvent(new CustomEvent(`tab-selected`,{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){if(this.useArrowNav){if(e.key===`ArrowLeft`){e.preventDefault();let n=this.findEnabledIndex(t,-1);n!==null&&this.tabRefs[n]?.focus()}if(e.key===`ArrowRight`){e.preventDefault();let n=this.findEnabledIndex(t,1);n!==null&&this.tabRefs[n]?.focus()}(e.key===`Enter`||e.key===` `||e.key===`Spacebar`||e.key===`ArrowDown`)&&(e.preventDefault(),this.handleClick(t))}}render(){let t=this.useArrowNav?`tablist`:`navigation`,r=this.separatorIconName||this.separatorIconPath?`pkt-tabs pkt-tabs--with-separator`:`pkt-tabs`;return e._`
2
2
  <div class=${r}>
3
- <div class="pkt-tabs__list" role=${n}>${t.n(this)}</div>
3
+ <div class="pkt-tabs__list" role=${t}>${n.n(this)}</div>
4
4
  </div>
5
- `}};e.n([e.u({type:Boolean,reflect:!0,attribute:`arrow-nav`})],o.prototype,`arrowNav`,void 0),e.n([e.u({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],o.prototype,`disableArrowNav`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`separator-icon-name`})],o.prototype,`separatorIconName`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`separator-icon-path`})],o.prototype,`separatorIconPath`,void 0),e.n([e.l()],o.prototype,`tabRefs`,void 0),e.n([e.l()],o.prototype,`disabledMap`,void 0),e.n([e.l()],o.prototype,`tabCount`,void 0),e.n([r.n({context:a}),e.l()],o.prototype,`context`,void 0);try{e.d(`pkt-tabs`)(o)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var s=class extends t.t{constructor(){super(),this.active=!1,this.disabled=!1,this.href=``,this.icon=``,this.controls=``,this.tag=``,this.tagSkin=`blue`,this.index=0,this.elementRef=i.t()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)})}updated(){this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)}handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleClick(this.index)}handleKeyDown(e){if(this.disabled&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleKeyUp(e,this.index)}render(){let r=this.context?.useArrowNav??!0,a=this.active&&!this.disabled,o=[a?`active`:``,this.disabled?`pkt-tabs__item--disabled`:``].filter(Boolean).join(` `),s=r?`tab`:void 0,c=r?a:void 0,l=this.disabled?-1:a||!r?void 0:-1,u=`pkt-icon--small ${this.icon===`check`?`pkt-tabs__status-icon`:``}`,d=e._`
5
+ `}};e.n([e.u({type:Boolean,reflect:!0,attribute:`arrow-nav`})],o.prototype,`arrowNav`,void 0),e.n([e.u({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],o.prototype,`disableArrowNav`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`separator-icon-name`})],o.prototype,`separatorIconName`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`separator-icon-path`})],o.prototype,`separatorIconPath`,void 0),e.n([e.l()],o.prototype,`tabRefs`,void 0),e.n([e.l()],o.prototype,`disabledMap`,void 0),e.n([e.l()],o.prototype,`tabCount`,void 0),e.n([r.n({context:a}),e.l()],o.prototype,`context`,void 0);try{e.d(`pkt-tabs`)(o)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var s=class extends n.t{constructor(){super(),this.active=!1,this.disabled=!1,this.href=``,this.icon=``,this.controls=``,this.tag=``,this.tagSkin=`blue`,this.index=0,this.elementRef=i.t()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)})}updated(){this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)}handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleClick(this.index)}handleKeyDown(e){if(this.disabled&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleKeyUp(e,this.index)}render(){let r=this.context?.useArrowNav??!0,a=this.active&&!this.disabled,o=[a?`active`:``,this.disabled?`pkt-tabs__item--disabled`:``].filter(Boolean).join(` `),s=r?`tab`:void 0,c=r?a:void 0,l=this.disabled?-1:a||!r?void 0:-1,u=`pkt-icon--small ${this.icon===`check`?`pkt-tabs__status-icon`:``}`,d=e._`
6
6
  ${this.icon?e._`<pkt-icon name=${this.icon} class=${u}></pkt-icon>`:``}
7
- <span>${t.n(this)}</span>
7
+ <span>${n.n(this)}</span>
8
8
  ${this.tag?e._`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:``}
9
9
  `;return this.href?e._`
10
10
  <a
11
11
  ${i.n(this.elementRef)}
12
- href=${n.t(this.disabled?void 0:this.href)}
12
+ href=${t.t(this.disabled?void 0:this.href)}
13
13
  class="pkt-tabs__link ${o}"
14
- role=${n.t(s)}
15
- aria-selected=${n.t(c)}
16
- aria-disabled=${n.t(this.disabled?`true`:void 0)}
17
- aria-controls=${n.t(this.controls||void 0)}
18
- tabindex=${n.t(l)}
14
+ role=${t.t(s)}
15
+ aria-selected=${t.t(c)}
16
+ aria-disabled=${t.t(this.disabled?`true`:void 0)}
17
+ aria-controls=${t.t(this.controls||void 0)}
18
+ tabindex=${t.t(l)}
19
19
  @click=${this.handleClick}
20
20
  @keydown=${this.handleKeyDown}
21
21
  >
@@ -27,11 +27,11 @@ const e=require("./element-DRc10X2R.cjs"),t=require("./element-with-slot-MkibfzH
27
27
  type="button"
28
28
  class="pkt-tabs__button pkt-link-button ${o}"
29
29
  ?disabled=${this.disabled}
30
- aria-disabled=${n.t(this.disabled?`true`:void 0)}
31
- role=${n.t(s)}
32
- aria-selected=${n.t(c)}
33
- aria-controls=${n.t(this.controls||void 0)}
34
- tabindex=${n.t(l)}
30
+ aria-disabled=${t.t(this.disabled?`true`:void 0)}
31
+ role=${t.t(s)}
32
+ aria-selected=${t.t(c)}
33
+ aria-controls=${t.t(this.controls||void 0)}
34
+ tabindex=${t.t(l)}
35
35
  @click=${this.handleClick}
36
36
  @keydown=${this.handleKeyDown}
37
37
  >