@oslokommune/punkt-elements 14.1.1 → 14.2.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 (54) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/booleanish-BKVonob4.cjs +1 -0
  3. package/dist/booleanish-C9R0tdXH.js +11 -0
  4. package/dist/{checkbox-BP5zOlPy.cjs → checkbox-C0TPnShf.cjs} +1 -1
  5. package/dist/{checkbox-CfXOh6Lw.js → checkbox-CnhA52o_.js} +1 -1
  6. package/dist/{combobox-BWsCkPH2.cjs → combobox-C1xwAju5.cjs} +1 -1
  7. package/dist/{combobox-BMznle0M.js → combobox-Dcp_fHcL.js} +2 -2
  8. package/dist/{datepicker-2s6FUxdi.js → datepicker-Bjb9GK1E.js} +2 -2
  9. package/dist/{datepicker-D1c9oP-2.cjs → datepicker-COIRRau0.cjs} +1 -1
  10. package/dist/index.d.ts +45 -160
  11. package/dist/{input-element-B0VPRK_E.js → input-element-B8M8Nppd.js} +77 -84
  12. package/dist/input-element-D697OAJo.cjs +1 -0
  13. package/dist/{input-wrapper-CAwzMR9o.js → input-wrapper-1PCXqtiu.js} +42 -49
  14. package/dist/{input-wrapper-DXg2N3wx.cjs → input-wrapper-CtBiAb04.cjs} +20 -20
  15. package/dist/pkt-checkbox.cjs +1 -1
  16. package/dist/pkt-checkbox.js +1 -1
  17. package/dist/pkt-combobox.cjs +1 -1
  18. package/dist/pkt-combobox.js +1 -1
  19. package/dist/pkt-datepicker.cjs +1 -1
  20. package/dist/pkt-datepicker.js +2 -2
  21. package/dist/pkt-header.cjs +11 -11
  22. package/dist/pkt-header.js +42 -48
  23. package/dist/pkt-index.cjs +1 -1
  24. package/dist/pkt-index.js +8 -8
  25. package/dist/pkt-input-wrapper.cjs +1 -1
  26. package/dist/pkt-input-wrapper.js +1 -1
  27. package/dist/pkt-radiobutton.cjs +1 -1
  28. package/dist/pkt-radiobutton.js +1 -1
  29. package/dist/pkt-select.cjs +1 -1
  30. package/dist/pkt-select.js +1 -1
  31. package/dist/pkt-textarea.cjs +1 -1
  32. package/dist/pkt-textarea.js +1 -1
  33. package/dist/pkt-textinput.cjs +1 -1
  34. package/dist/pkt-textinput.js +1 -1
  35. package/dist/{radiobutton-BuKXgQm_.cjs → radiobutton-BkqaqO5E.cjs} +1 -1
  36. package/dist/{radiobutton-C_MzK8dE.js → radiobutton-Caq8-GhM.js} +1 -1
  37. package/dist/{select-Ds4Ws1_6.cjs → select-3dwlk22G.cjs} +1 -1
  38. package/dist/{select-CteaDnzz.js → select-_C-yztI0.js} +2 -2
  39. package/dist/{textarea-zeFp1hxO.cjs → textarea-DyUy8u7X.cjs} +1 -1
  40. package/dist/{textarea-D4T9yqw7.js → textarea-a6T4aJJU.js} +2 -2
  41. package/dist/{textinput-Cddq4eF_.js → textinput-DIuM70dd.js} +2 -2
  42. package/dist/{textinput-DFFL5v-U.cjs → textinput-IN3b0nSH.cjs} +1 -1
  43. package/package.json +2 -2
  44. package/src/components/accordion/accordion.ts +2 -1
  45. package/src/components/alert/alert.ts +2 -2
  46. package/src/components/button/button.ts +2 -3
  47. package/src/components/card/card.ts +2 -3
  48. package/src/components/header/types.ts +17 -78
  49. package/src/components/heading/heading.ts +4 -3
  50. package/src/components/input-wrapper/input-wrapper.ts +2 -16
  51. package/src/components/messagebox/messagebox.ts +2 -1
  52. package/src/components/progressbar/progressbar.ts +1 -1
  53. package/src/components/tag/tag.ts +2 -2
  54. package/dist/input-element-BmXkhljw.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,24 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [14.2.0](https://github.com/oslokommune/punkt/compare/14.1.1...14.2.0) (2026-02-04)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ Ingen
12
+
13
+ ### Features
14
+ * Ny mappe `shared-types` for å samle alle TS-definisjoner som deles mellom komponenter (#3225).
15
+
16
+
17
+ ### Bug Fixes
18
+ Ingen
19
+
20
+ ### Chores
21
+ Ingen
22
+
23
+ ---
24
+
25
+
8
26
  ## [14.1.0](https://github.com/oslokommune/punkt/compare/14.0.4...14.1.0) (2026-02-03)
9
27
 
10
28
  ### ⚠ BREAKING CHANGES
@@ -0,0 +1 @@
1
+ "use strict";const t={fromAttribute(r){return r==null?!1:r===""||r==="true"||r===!0?!0:r==="false"||r===!1?!1:!!r},toAttribute(r){return r?"true":"false"}};exports.booleanishConverter=t;
@@ -0,0 +1,11 @@
1
+ const t = {
2
+ fromAttribute(r) {
3
+ return r == null ? !1 : r === "" || r === "true" || r === !0 ? !0 : r === "false" || r === !1 ? !1 : !!r;
4
+ },
5
+ toAttribute(r) {
6
+ return r ? "true" : "false";
7
+ }
8
+ };
9
+ export {
10
+ t as b
11
+ };
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-CJ_QKaki.cjs"),o=require("./input-element-BmXkhljw.cjs"),r=require("./ref-BFa5Utho.cjs"),p=require("./class-map-C_erArZz.cjs");var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(l,e,h,a)=>{for(var s=a>1?void 0:a?d(e,h):e,c=l.length-1,n;c>=0;c--)(n=l[c])&&(s=(a?n(e,h,s):n(s))||s);return a&&s&&u(e,h,s),s};exports.PktCheckbox=class extends o.PktInputElement{constructor(){super(...arguments),this.inputRef=r.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,h,a){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,h,a)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),e.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(e)}render(){const e=p.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),h=p.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=p.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),s="pkt-tag pkt-tag--small pkt-tag--thin-text",c=()=>t.x`
1
+ "use strict";const t=require("./element-CJ_QKaki.cjs"),o=require("./input-element-D697OAJo.cjs"),r=require("./ref-BFa5Utho.cjs"),p=require("./class-map-C_erArZz.cjs");var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(l,e,h,a)=>{for(var s=a>1?void 0:a?d(e,h):e,c=l.length-1,n;c>=0;c--)(n=l[c])&&(s=(a?n(e,h,s):n(s))||s);return a&&s&&u(e,h,s),s};exports.PktCheckbox=class extends o.PktInputElement{constructor(){super(...arguments),this.inputRef=r.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,h,a){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,h,a)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),e.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(e)}render(){const e=p.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),h=p.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=p.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),s="pkt-tag pkt-tag--small pkt-tag--thin-text",c=()=>t.x`
2
2
  ${this.tagText?t.x`<span class=${s+" pkt-tag--gray"}>${this.tagText}</span>`:t.E}
3
3
  ${this.optionalTag?t.x`<span class=${s+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.E}
4
4
  ${this.requiredTag?t.x`<span class=${s+" pkt-tag--beige"}>${this.requiredText}</span>`:t.E}
@@ -1,5 +1,5 @@
1
1
  import { E as r, x as p, n as s, a as d } from "./element-CRDRygXu.js";
2
- import { P as k } from "./input-element-B0VPRK_E.js";
2
+ import { P as k } from "./input-element-B8M8Nppd.js";
3
3
  import { e as f, n as b } from "./ref-Xa5dbh--.js";
4
4
  import { e as u } from "./class-map-wy7PUk0P.js";
5
5
  var g = Object.defineProperty, m = Object.getOwnPropertyDescriptor, i = (t, a, n, l) => {
@@ -1,4 +1,4 @@
1
- "use strict";const a=require("./element-CJ_QKaki.cjs"),c=require("./if-defined-Bc9-_I01.cjs"),d=require("./state-DSjcvzDN.cjs"),r=require("./ref-BFa5Utho.cjs"),y=require("./class-map-C_erArZz.cjs"),O=require("./repeat-BZb41H64.cjs"),$=require("./input-element-BmXkhljw.cjs"),I=require("./pkt-options-controller-CiuBG6Lt.cjs"),w=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-DXg2N3wx.cjs");require("./icon-MRx-m0Or.cjs");require("./tag-B02fKJ66.cjs");require("./listbox-DnoqOo5u.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,A=Object.getOwnPropertyDescriptor,h=(v,t,e,i)=>{for(var s=i>1?void 0:i?A(t,e):t,n=v.length-1,l;n>=0;n--)(l=v[n])&&(s=(i?l(t,e,s):l(s))||s);return i&&s&&V(t,e,s),s};exports.PktCombobox=class extends $.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=R.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=r.e(),this.arrowRef=r.e(),this.listboxRef=r.e(),this.focusRef=r.e(),this.optionTagRef=r.e(),this.optionsController=new I.PktOptionsSlotController(this),this.slotController=new w.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var t;if(super.connectedCallback(),document&&document.body.addEventListener("click",e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.handleFocusOut(e)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const e=((t=this.options)==null?void 0:t.filter(i=>i.userAdded))||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController.nodes.length){const e=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const s={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(s.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(s.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(s.description=i.getAttribute("description")||void 0),s.fulltext=s.value+s.label+(s.prefix||""),e.push(s)}),e.length&&(this.options=[...e],this._options=[...e])}}updated(t){if(t.has("_value")&&this.valueChanged(this._value,t.get("_value")),t.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),t.has("defaultOptions")&&this.defaultOptions.length){const e=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(t.has("options")){const s=(t.get("options")||this._options||[]).filter(l=>l&&l.userAdded).filter(l=>!(Array.isArray(this.options)?this.options:[]).some(o=>o.value===l.value)),n=[...s,...this.options];this._options=n,s.length>0&&(this.options=n),this._options.forEach(l=>{if(l.value&&!l.label&&(l.label=l.value),l.selected&&!this._value.includes(l.value)){const o=[...this._value];this._value=[...this._value,l.value],this.valueChanged(this._value,o)}l.fulltext=l.value+l.label+(l.prefix||""),l.selected=l.selected||this._value.includes(l.value)})}t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(t)}attributeChangedCallback(t,e,i){t==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),t==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!this._value.includes(s.value)&&(this._value=[...this._value,s.value]),s.fulltext=s.value+s.label+(s.prefix||"")}),this._search=""),super.attributeChangedCallback(t,e,i)}render(){return a.x`
1
+ "use strict";const a=require("./element-CJ_QKaki.cjs"),c=require("./if-defined-Bc9-_I01.cjs"),d=require("./state-DSjcvzDN.cjs"),r=require("./ref-BFa5Utho.cjs"),y=require("./class-map-C_erArZz.cjs"),O=require("./repeat-BZb41H64.cjs"),$=require("./input-element-D697OAJo.cjs"),I=require("./pkt-options-controller-CiuBG6Lt.cjs"),w=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-CtBiAb04.cjs");require("./icon-MRx-m0Or.cjs");require("./tag-B02fKJ66.cjs");require("./listbox-DnoqOo5u.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,A=Object.getOwnPropertyDescriptor,h=(v,t,e,i)=>{for(var s=i>1?void 0:i?A(t,e):t,n=v.length-1,l;n>=0;n--)(l=v[n])&&(s=(i?l(t,e,s):l(s))||s);return i&&s&&V(t,e,s),s};exports.PktCombobox=class extends $.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=R.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=r.e(),this.arrowRef=r.e(),this.listboxRef=r.e(),this.focusRef=r.e(),this.optionTagRef=r.e(),this.optionsController=new I.PktOptionsSlotController(this),this.slotController=new w.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var t;if(super.connectedCallback(),document&&document.body.addEventListener("click",e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.handleFocusOut(e)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const e=((t=this.options)==null?void 0:t.filter(i=>i.userAdded))||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController.nodes.length){const e=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const s={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(s.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(s.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(s.description=i.getAttribute("description")||void 0),s.fulltext=s.value+s.label+(s.prefix||""),e.push(s)}),e.length&&(this.options=[...e],this._options=[...e])}}updated(t){if(t.has("_value")&&this.valueChanged(this._value,t.get("_value")),t.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),t.has("defaultOptions")&&this.defaultOptions.length){const e=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(t.has("options")){const s=(t.get("options")||this._options||[]).filter(l=>l&&l.userAdded).filter(l=>!(Array.isArray(this.options)?this.options:[]).some(o=>o.value===l.value)),n=[...s,...this.options];this._options=n,s.length>0&&(this.options=n),this._options.forEach(l=>{if(l.value&&!l.label&&(l.label=l.value),l.selected&&!this._value.includes(l.value)){const o=[...this._value];this._value=[...this._value,l.value],this.valueChanged(this._value,o)}l.fulltext=l.value+l.label+(l.prefix||""),l.selected=l.selected||this._value.includes(l.value)})}t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(t)}attributeChangedCallback(t,e,i){t==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),t==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!this._value.includes(s.value)&&(this._value=[...this._value,s.value]),s.fulltext=s.value+s.label+(s.prefix||"")}),this._search=""),super.attributeChangedCallback(t,e,i)}render(){return a.x`
2
2
  <pkt-input-wrapper
3
3
  .label=${this.label}
4
4
  .helptext=${this.helptext}
@@ -4,10 +4,10 @@ import { r as c } from "./state-DS_kr2Fy.js";
4
4
  import { e as _, n as v } from "./ref-Xa5dbh--.js";
5
5
  import { e as k } from "./class-map-wy7PUk0P.js";
6
6
  import { c as R } from "./repeat-CJ79egkN.js";
7
- import { P as V } from "./input-element-B0VPRK_E.js";
7
+ import { P as V } from "./input-element-B8M8Nppd.js";
8
8
  import { P as A } from "./pkt-options-controller-CZO1nxZ8.js";
9
9
  import { P as C } from "./pkt-slot-controller-BPGj-LC5.js";
10
- import "./input-wrapper-CAwzMR9o.js";
10
+ import "./input-wrapper-1PCXqtiu.js";
11
11
  import "./icon-BB7e5iQN.js";
12
12
  import "./tag-CES41g0D.js";
13
13
  import "./listbox-mvKKzH-v.js";
@@ -1,10 +1,10 @@
1
1
  import { P as L, E as I, x as o, n as l, a as w } from "./element-CRDRygXu.js";
2
2
  import { r as G } from "./state-DS_kr2Fy.js";
3
3
  import { s as K, f as q, n as F, a as J, i as Q, b as M, v as D, d as X, e as Y, p as Z, g as W } from "./calendar-CvfMj3fA.js";
4
- import { P as ee } from "./input-element-B0VPRK_E.js";
4
+ import { P as ee } from "./input-element-B8M8Nppd.js";
5
5
  import { e as m, n as v } from "./ref-Xa5dbh--.js";
6
6
  import "./icon-BB7e5iQN.js";
7
- import "./input-wrapper-CAwzMR9o.js";
7
+ import "./input-wrapper-1PCXqtiu.js";
8
8
  import { e as $ } from "./class-map-wy7PUk0P.js";
9
9
  import { c as te } from "./repeat-CJ79egkN.js";
10
10
  import "./tag-CES41g0D.js";
@@ -1,4 +1,4 @@
1
- "use strict";const l=require("./element-CJ_QKaki.cjs"),B=require("./state-DSjcvzDN.cjs"),u=require("./calendar-ZzLAjDpv.cjs"),A=require("./input-element-BmXkhljw.cjs"),p=require("./ref-BFa5Utho.cjs");require("./icon-MRx-m0Or.cjs");require("./input-wrapper-DXg2N3wx.cjs");const m=require("./class-map-C_erArZz.cjs"),M=require("./repeat-BZb41H64.cjs");require("./tag-B02fKJ66.cjs");const I=require("./utils-byXsEz1u.cjs"),g=require("./if-defined-Bc9-_I01.cjs"),F=require("./pkt-slot-controller-BzddBp7z.cjs");var j=Object.defineProperty,q=Object.getOwnPropertyDescriptor,b=(s,e,t,a)=>{for(var i=a>1?void 0:a?q(e,t):e,n=s.length-1,r;n>=0;n--)(r=s[n])&&(i=(a?r(e,t,i):r(i))||i);return a&&i&&j(e,t,i),i};exports.PktDateTags=class extends l.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=I.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},l.x`
1
+ "use strict";const l=require("./element-CJ_QKaki.cjs"),B=require("./state-DSjcvzDN.cjs"),u=require("./calendar-ZzLAjDpv.cjs"),A=require("./input-element-D697OAJo.cjs"),p=require("./ref-BFa5Utho.cjs");require("./icon-MRx-m0Or.cjs");require("./input-wrapper-CtBiAb04.cjs");const m=require("./class-map-C_erArZz.cjs"),M=require("./repeat-BZb41H64.cjs");require("./tag-B02fKJ66.cjs");const I=require("./utils-byXsEz1u.cjs"),g=require("./if-defined-Bc9-_I01.cjs"),F=require("./pkt-slot-controller-BzddBp7z.cjs");var j=Object.defineProperty,q=Object.getOwnPropertyDescriptor,b=(s,e,t,a)=>{for(var i=a>1?void 0:a?q(e,t):e,n=s.length-1,r;n>=0;n--)(r=s[n])&&(i=(a?r(e,t,i):r(i))||i);return a&&i&&j(e,t,i),i};exports.PktDateTags=class extends l.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=I.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},l.x`
2
2
  <div class=${m.e(this.classes)} aria-live="polite">
3
3
  ${Array.isArray(this.dates)&&this.dates[0]?M.c(u.sortDateStrings((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return l.x` <pkt-tag
4
4
  id=${this.idBase+e+"-tag"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import { Booleanish } from '../../../../../shared-types';
2
+ import { Booleanish as Booleanish_2 } from '../../../../shared-types';
3
+ import { IAriaAttributes } from '../../../../../shared-types';
1
4
  import { LitElement } from 'lit';
2
5
  import { nothing } from 'lit';
3
6
  import { PktIconName } from '@oslokommune/punkt-assets/dist/icons/icon';
@@ -5,20 +8,21 @@ import { PropertyValues } from 'lit';
5
8
  import { ReactiveController } from 'lit';
6
9
  import { ReactiveControllerHost } from 'lit';
7
10
  import { Ref } from 'lit/directives/ref.js';
11
+ import { Representing } from '../../../../../shared-types';
12
+ import { TAccordionSkin } from '../../../../../shared-types';
13
+ import { TAlertSkin } from '../../../../../shared-types';
14
+ import { TAriaLive } from '../../../../../shared-types';
15
+ import { TCardSkin } from '../../../../../shared-types';
8
16
  import { TemplateResult } from 'lit-html';
9
17
  import { TemplateResult as TemplateResult_2 } from 'lit';
10
-
11
- declare type Booleanish = boolean | 'true' | 'false';
12
-
13
- declare type Booleanish_2 = boolean | 'true' | 'false';
14
-
15
- /**
16
- * Booleanish type that accepts boolean or string "true"/"false"
17
- * This allows attributes to be set as strings in HTML
18
- */
19
- declare type Booleanish_3 = boolean | 'true' | 'false';
20
-
21
- declare type Booleanish_4 = boolean | 'true' | 'false';
18
+ import { THeadingLevel } from '../../../../../shared-types';
19
+ import { THeadingSize } from '../../../../../shared-types';
20
+ import { THeadingWeight } from '../../../../../shared-types';
21
+ import { THTMLButtonType } from '../../../../../shared-types';
22
+ import { TLayout } from '../../../../../shared-types';
23
+ import { TMessageboxSkin } from '../../../../../shared-types';
24
+ import { User } from '../../../../../shared-types';
25
+ import { UserMenuItem } from '../../../../../shared-types';
22
26
 
23
27
  /**
24
28
  * We define all props as optional. Native HTML attributes are optional by default,
@@ -27,55 +31,6 @@ declare type Booleanish_4 = boolean | 'true' | 'false';
27
31
  */
28
32
  declare type ElementProps<Element, PropKeys extends keyof Element> = Partial<Pick<Element, PropKeys>>;
29
33
 
30
- declare interface IAriaAttributes {
31
- 'aria-activedescendant'?: string;
32
- 'aria-controls'?: string;
33
- 'aria-describedby'?: string;
34
- 'aria-details'?: string;
35
- 'aria-errormessage'?: string;
36
- 'aria-flowto'?: string;
37
- 'aria-label'?: string;
38
- 'aria-labelledby'?: string;
39
- 'aria-owns'?: string;
40
- 'aria-roledescription'?: string;
41
- 'aria-autocomplete'?: TAriaAutoComplete;
42
- 'aria-checked'?: TAriaBooleanMixed;
43
- 'aria-current'?: TAriaCurrent;
44
- 'aria-disabled'?: TAriaBoolean;
45
- 'aria-expanded'?: TAriaBoolean;
46
- 'aria-haspopup'?: TAriaHasPopup;
47
- 'aria-hidden'?: TAriaBoolean;
48
- 'aria-invalid'?: TAriaInvalid;
49
- 'aria-keyshortcuts'?: string;
50
- 'aria-level'?: number;
51
- 'aria-modal'?: TAriaBoolean;
52
- 'aria-multiline'?: TAriaBoolean;
53
- 'aria-multiselectable'?: TAriaBoolean;
54
- 'aria-orientation'?: TAriaOrientation;
55
- 'aria-placeholder'?: string;
56
- 'aria-pressed'?: TAriaBooleanMixed;
57
- 'aria-readonly'?: TAriaBoolean;
58
- 'aria-required'?: TAriaBoolean;
59
- 'aria-selected'?: TAriaBoolean;
60
- 'aria-sort'?: TAriaSort;
61
- 'aria-atomic'?: TAriaBoolean;
62
- 'aria-busy'?: TAriaBoolean;
63
- 'aria-live'?: TAriaLive;
64
- 'aria-relevant'?: TAriaRelevant | string;
65
- 'aria-colcount'?: number;
66
- 'aria-colindex'?: number;
67
- 'aria-colspan'?: number;
68
- 'aria-rowcount'?: number;
69
- 'aria-rowindex'?: number;
70
- 'aria-rowspan'?: number;
71
- 'aria-posinset'?: number;
72
- 'aria-setsize'?: number;
73
- 'aria-valuemax'?: number;
74
- 'aria-valuemin'?: number;
75
- 'aria-valuenow'?: number;
76
- 'aria-valuetext'?: string;
77
- }
78
-
79
34
  /**
80
35
  * Type definitions for the datepicker component family
81
36
  */
@@ -260,7 +215,7 @@ export declare interface IPktConsent {
260
215
  */
261
216
  export declare interface IPktHeader {
262
217
  /** Hide the Oslo logo */
263
- hideLogo?: Booleanish_3;
218
+ hideLogo?: Booleanish;
264
219
  /** Logo link URL */
265
220
  logoLink?: string;
266
221
  /** Service name displayed in the header */
@@ -268,7 +223,7 @@ export declare interface IPktHeader {
268
223
  /** Service link URL */
269
224
  serviceLink?: string;
270
225
  /** Use compact header height */
271
- compact?: Booleanish_3;
226
+ compact?: Booleanish;
272
227
  /** Header position. 'fixed' fixes to top of viewport, 'relative' follows document flow. Default: 'fixed' */
273
228
  position?: THeaderPosition;
274
229
  /** Scroll behavior. 'hide' hides header on scroll down, 'none' keeps it visible. Default: 'hide' */
@@ -280,13 +235,13 @@ export declare interface IPktHeader {
280
235
  /** Representation object */
281
236
  representing?: IPktHeaderRepresenting;
282
237
  /** Allow user to change representation */
283
- canChangeRepresentation?: Booleanish_3;
238
+ canChangeRepresentation?: Booleanish;
284
239
  /** Logout button placement */
285
240
  logOutButtonPlacement?: TPktHeaderLogOutButtonPlacement;
286
241
  /** Whether there's a logout handler attached (required for logout button to show) */
287
- hasLogOut?: Booleanish_3;
242
+ hasLogOut?: Booleanish;
288
243
  /** Show search field */
289
- showSearch?: Booleanish_3;
244
+ showSearch?: Booleanish;
290
245
  /** Search field placeholder */
291
246
  searchPlaceholder?: string;
292
247
  /** Controlled search value */
@@ -299,50 +254,20 @@ export declare interface IPktHeader {
299
254
  openedMenu?: TPktHeaderMenu;
300
255
  }
301
256
 
302
- /**
303
- * Representation object containing information about the organization/entity being represented
304
- */
305
- export declare interface IPktHeaderRepresenting {
306
- /** Name of the organization or entity */
307
- name: string;
308
- /** Short name or initials (deprecated) */
309
- shortname?: string;
310
- /** Organization number */
311
- orgNumber?: string | number;
312
- }
257
+ export declare type IPktHeaderRepresenting = Representing;
313
258
 
314
- /**
315
- * User object containing information about the logged-in user
316
- */
317
- export declare interface IPktHeaderUser {
318
- /** Full name of the user */
319
- name: string;
320
- /** Short name or initials (deprecated) */
321
- shortname?: string;
322
- /** Last login timestamp (ISO string or Date) */
323
- lastLoggedIn?: Date | string;
324
- }
259
+ export declare type IPktHeaderUser = User;
325
260
 
326
261
  declare interface IPktHeaderUserMenu {
327
262
  user: IPktHeaderUser;
328
263
  formattedLastLoggedIn?: string;
329
264
  representing?: IPktHeaderRepresenting;
330
265
  userMenu?: IPktHeaderUserMenuItem[];
331
- canChangeRepresentation?: Booleanish_3;
332
- logoutOnClick?: Booleanish_3;
266
+ canChangeRepresentation?: Booleanish;
267
+ logoutOnClick?: Booleanish;
333
268
  }
334
269
 
335
- /**
336
- * Menu item in the user menu
337
- */
338
- export declare interface IPktHeaderUserMenuItem {
339
- /** Icon name to display */
340
- iconName?: PktIconName;
341
- /** Text for the menu item */
342
- title: string;
343
- /** Link URL or click handler function */
344
- target: string | (() => void);
345
- }
270
+ export declare type IPktHeaderUserMenuItem = UserMenuItem<PktIconName>;
346
271
 
347
272
  export declare interface IPktHeading {
348
273
  size?: TPktHeadingSize;
@@ -1055,11 +980,11 @@ export declare class PktHeader extends PktElement<IPktHeader> implements IPktHea
1055
980
  logOutButtonPlacement: TPktHeaderLogOutButtonPlacement;
1056
981
  position: THeaderPosition;
1057
982
  scrollBehavior: THeaderScrollBehavior;
1058
- hideLogo: Booleanish_3;
1059
- compact: Booleanish_3;
1060
- showSearch: Booleanish_3;
1061
- canChangeRepresentation: Booleanish_3;
1062
- hasLogOut: Booleanish_3;
983
+ hideLogo: Booleanish;
984
+ compact: Booleanish;
985
+ showSearch: Booleanish;
986
+ canChangeRepresentation: Booleanish;
987
+ hasLogOut: Booleanish;
1063
988
  user?: IPktHeaderUser;
1064
989
  userMenu?: IPktHeaderUserMenuItem[];
1065
990
  representing?: IPktHeaderRepresenting;
@@ -1087,11 +1012,11 @@ export declare class PktHeaderService extends PktElement<IPktHeader> implements
1087
1012
  logOutButtonPlacement: TPktHeaderLogOutButtonPlacement;
1088
1013
  position: THeaderPosition;
1089
1014
  scrollBehavior: THeaderScrollBehavior;
1090
- hideLogo: Booleanish_3;
1091
- compact: Booleanish_3;
1092
- showSearch: Booleanish_3;
1093
- canChangeRepresentation: Booleanish_3;
1094
- hasLogOut: Booleanish_3;
1015
+ hideLogo: Booleanish;
1016
+ compact: Booleanish;
1017
+ showSearch: Booleanish;
1018
+ canChangeRepresentation: Booleanish;
1019
+ hasLogOut: Booleanish;
1095
1020
  user?: IPktHeaderUser;
1096
1021
  userMenu?: IPktHeaderUserMenuItem[];
1097
1022
  representing?: IPktHeaderRepresenting;
@@ -1162,8 +1087,8 @@ export declare class PktHeaderUserMenu extends PktElement<IPktHeaderUserMenu> im
1162
1087
  formattedLastLoggedIn?: string;
1163
1088
  representing?: IPktHeaderRepresenting;
1164
1089
  userMenu?: IPktHeaderUserMenuItem[];
1165
- canChangeRepresentation: Booleanish_3;
1166
- logoutOnClick: Booleanish_3;
1090
+ canChangeRepresentation: Booleanish;
1091
+ logoutOnClick: Booleanish;
1167
1092
  private handleChangeRepresentation;
1168
1093
  private handleLogout;
1169
1094
  private handleMenuItemClick;
@@ -1299,7 +1224,7 @@ export declare class PktInputWrapper extends PktElement<Props_6> {
1299
1224
  ariaDescribedby: string | undefined;
1300
1225
  hasFieldset: boolean;
1301
1226
  role: string | null;
1302
- useWrapper: Booleanish_4;
1227
+ useWrapper: Booleanish;
1303
1228
  protected updated(changedProperties: PropertyValues): void;
1304
1229
  render(): TemplateResult<1>;
1305
1230
  private toggleDropdown;
@@ -1687,46 +1612,10 @@ declare interface TabsContext {
1687
1612
  handleKeyUp: (event: KeyboardEvent, index: number) => void;
1688
1613
  }
1689
1614
 
1690
- declare type TAlertSkin = 'error' | 'success' | 'warning' | 'info';
1691
-
1692
- declare type TAriaAutoComplete = 'none' | 'inline' | 'list' | 'both';
1693
-
1694
- /**
1695
- * aria.ts
1696
- *
1697
- * Typedefinisjoner for ARIA-attributter og roller.
1698
- * Eksportert slik at de kan importere andre steder:
1699
- *
1700
- * import type {
1701
- * TAriaAttributes,
1702
- * TAriaLive,
1703
- * // ...
1704
- * } from './aria-types';
1705
- */
1706
- declare type TAriaBoolean = boolean | 'true' | 'false';
1707
-
1708
- declare type TAriaBooleanMixed = TAriaBoolean | 'mixed';
1709
-
1710
- declare type TAriaCurrent = TAriaBoolean | 'page' | 'step' | 'location' | 'date' | 'time';
1711
-
1712
- declare type TAriaHasPopup = TAriaBoolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
1713
-
1714
- declare type TAriaInvalid = TAriaBoolean | 'grammar' | 'spelling';
1715
-
1716
- declare type TAriaLive = 'off' | 'polite' | 'assertive';
1717
-
1718
- declare type TAriaOrientation = 'horizontal' | 'vertical';
1719
-
1720
- declare type TAriaRelevant = 'additions' | 'removals' | 'text' | 'all';
1721
-
1722
- declare type TAriaSort = 'none' | 'ascending' | 'descending' | 'other';
1723
-
1724
1615
  declare type TCardImageShape = 'square' | 'round';
1725
1616
 
1726
1617
  declare type TCardPadding = 'none' | 'default';
1727
1618
 
1728
- declare type TCardSkin = 'outlined' | 'outlined-beige' | 'gray' | 'beige' | 'green' | 'blue';
1729
-
1730
1619
  declare type TCardTagPosition = 'top' | 'bottom';
1731
1620
 
1732
1621
  declare type TCounterPosition = 'top' | 'bottom';
@@ -1745,15 +1634,11 @@ declare type THeaderScrollBehavior = 'hide' | 'none';
1745
1634
 
1746
1635
  declare type TISODate = `${TYear}-${TMonth}-${TDay}`;
1747
1636
 
1748
- declare type TLayout = 'vertical' | 'horizontal';
1749
-
1750
1637
  declare type TLinkCardSkin = 'normal' | 'no-padding' | 'blue' | 'beige' | 'green' | 'gray' | 'beige-outline' | 'gray-outline';
1751
1638
 
1752
- declare type TMessageboxSkin = 'beige' | 'blue' | 'red' | 'green';
1753
-
1754
1639
  declare type TMonth = `${number}${number}`;
1755
1640
 
1756
- export declare type TPktAccordionSkin = 'borderless' | 'outlined' | 'beige' | 'blue';
1641
+ export declare type TPktAccordionSkin = TAccordionSkin;
1757
1642
 
1758
1643
  export declare type TPktButtonColor = 'blue' | 'blue-outline' | 'green' | 'green-outline' | 'green-dark' | 'green-dark-outline' | 'beige-light' | 'beige-dark-outline' | 'yellow' | 'yellow-outline' | 'red' | 'red-outline';
1759
1644
 
@@ -1765,7 +1650,7 @@ export declare type TPktButtonSkin = 'primary' | 'secondary' | 'tertiary';
1765
1650
 
1766
1651
  export declare type TPktButtonState = 'normal' | 'focus' | 'hover' | 'active';
1767
1652
 
1768
- export declare type TPktButtonType = 'button' | 'submit' | 'reset';
1653
+ export declare type TPktButtonType = THTMLButtonType;
1769
1654
 
1770
1655
  export declare type TPktButtonVariant = 'label-only' | 'icon-left' | 'icon-right' | 'icon-only' | 'icons-right-and-left';
1771
1656
 
@@ -1781,11 +1666,11 @@ export declare type TPktHeaderLogOutButtonPlacement = 'userMenu' | 'header' | 'b
1781
1666
  */
1782
1667
  export declare type TPktHeaderMenu = 'none' | 'slot' | 'search' | 'user';
1783
1668
 
1784
- export declare type TPktHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
1669
+ export declare type TPktHeadingLevel = THeadingLevel;
1785
1670
 
1786
- export declare type TPktHeadingSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
1671
+ export declare type TPktHeadingSize = THeadingSize;
1787
1672
 
1788
- declare type TPktHeadingWeight = 'light' | 'regular' | 'medium' | 'bold';
1673
+ declare type TPktHeadingWeight = THeadingWeight;
1789
1674
 
1790
1675
  export declare type TPktLoaderVariant = 'blue' | 'rainbow' | 'shapes';
1791
1676
 
@@ -1813,7 +1698,7 @@ export declare type TTabItemSkin = 'blue' | 'green' | 'red' | 'beige' | 'yellow'
1813
1698
 
1814
1699
  export declare type TTagSkin = 'blue' | 'blue-dark' | 'blue-light' | 'green' | 'red' | 'yellow' | 'beige' | 'gray' | 'grey';
1815
1700
 
1816
- export declare type TTagType = 'button' | 'reset' | 'submit';
1701
+ export declare type TTagType = THTMLButtonType;
1817
1702
 
1818
1703
  declare type TYear = `${number}${number}${number}${number}`;
1819
1704