@oslokommune/punkt-elements 12.41.0 → 12.42.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,40 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [12.42.0](https://github.com/oslokommune/punkt/compare/12.41.1...12.42.0) (2025-06-12)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ Ingen
12
+
13
+ ### Features
14
+ Ingen
15
+
16
+ ### Bug Fixes
17
+ Ingen
18
+
19
+ ### Chores
20
+ Ingen
21
+
22
+ ---
23
+
24
+
25
+ ## [12.41.1](https://github.com/oslokommune/punkt/compare/12.41.0...12.41.1) (2025-06-11)
26
+
27
+ ### ⚠ BREAKING CHANGES
28
+ Ingen
29
+
30
+ ### Features
31
+ Ingen
32
+
33
+ ### Bug Fixes
34
+ Ingen
35
+
36
+ ### Chores
37
+ Ingen
38
+
39
+ ---
40
+
41
+
8
42
  ## [12.41.0](https://github.com/oslokommune/punkt/compare/12.40.10...12.41.0) (2025-06-10)
9
43
 
10
44
  ### ⚠ BREAKING CHANGES
@@ -0,0 +1,32 @@
1
+ "use strict";const c=require("./class-map-DWDPOqjO.cjs"),t=require("./element-90YeMNbV.cjs"),d=require("./state-D-Recv7U.cjs"),h=require("./pkt-slot-controller-Da-RgXfS.cjs"),u=require("./ref-B-w1vCo8.cjs"),k=require("./classutils-BwNK82ZQ.cjs");require("./icon-B1_BRNqf.cjs");const v={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},a={props:v};var f=Object.defineProperty,_=Object.getOwnPropertyDescriptor,i=(o,e,s,l)=>{for(var r=l>1?void 0:l?_(e,s):e,p=o.length-1,n;p>=0;p--)(n=o[p])&&(r=(l?n(e,s,r):n(r))||r);return l&&r&&f(e,s,r),r};exports.PktAlert=class extends t.PktElement{constructor(){super(),this.defaultSlot=u.e(),this.compact=a.props.compact.default,this.title="",this.skin=a.props.skin.default,this.ariaLive=a.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=a.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new h.PktSlotController(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(e,s,l){e==="ariaLive"&&(this["aria-live"]=l),super.attributeChangedCallback(e,s,l)}updated(e){super.updated(e),e.has("ariaLive")&&(this["aria-live"]=this.ariaLive),e.has("_isClosed")&&k.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const e={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},s={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return t.x`
2
+ <div class=${c.e(e)} aria-live=${this["aria-live"]}>
3
+ <div class=${c.e(s)}>
4
+ <pkt-icon
5
+ class="pkt-alert__icon"
6
+ aria-hidden="true"
7
+ name=${this.skin==="info"?"alert-information":`alert-${this.skin}`}
8
+ ></pkt-icon>
9
+
10
+ ${this.closeAlert?t.x`
11
+ <div class="pkt-alert__close">
12
+ <pkt-button
13
+ tabindex="0"
14
+ aria-label="close"
15
+ size=${this.compact?"small":"medium"}
16
+ type="button"
17
+ skin="tertiary"
18
+ iconName="close"
19
+ variant="icon-only"
20
+ @click=${this.close}
21
+ >
22
+ </pkt-button>
23
+ </div>
24
+ `:t.E}
25
+ ${this.title?t.x`<div class="pkt-alert__title">${this.title}</div>`:t.E}
26
+
27
+ <div class="pkt-alert__text" ${u.n(this.defaultSlot)}></div>
28
+
29
+ ${this.date?t.x`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:t.E}
30
+ </div>
31
+ </div>
32
+ `}};i([t.n({type:Boolean,reflect:!1})],exports.PktAlert.prototype,"compact",2);i([t.n({type:String,reflect:!0})],exports.PktAlert.prototype,"title",2);i([t.n({type:String,reflect:!0})],exports.PktAlert.prototype,"skin",2);i([t.n({type:String})],exports.PktAlert.prototype,"ariaLive",2);i([t.n({type:String,reflect:!0})],exports.PktAlert.prototype,"aria-live",2);i([t.n({type:Boolean,reflect:!0})],exports.PktAlert.prototype,"closeAlert",2);i([t.n({type:String,reflect:!0})],exports.PktAlert.prototype,"date",2);i([t.n({type:String,reflect:!0})],exports.PktAlert.prototype,"role",2);i([d.r()],exports.PktAlert.prototype,"_isClosed",2);exports.PktAlert=i([t.t("pkt-alert")],exports.PktAlert);
@@ -1,11 +1,11 @@
1
1
  import { e as u } from "./class-map-m7ZCZ49w.js";
2
- import { P as f, E as h, x as p, n as l, a as v } from "./element-gAd63VwC.js";
2
+ import { P as f, E as h, x as p, n as a, a as v } from "./element-gAd63VwC.js";
3
3
  import { r as k } from "./state-BxrO4zNJ.js";
4
4
  import { P as m } from "./pkt-slot-controller-DtDaD9q_.js";
5
5
  import { e as _, n as b } from "./ref-DnSbnXsj.js";
6
- import { u as C } from "./classutils-RQs1k6D9.js";
6
+ import { u as y } from "./classutils-RQs1k6D9.js";
7
7
  import "./icon-CO1TLSs5.js";
8
- const y = {
8
+ const C = {
9
9
  skin: {
10
10
  default: "info"
11
11
  },
@@ -19,16 +19,16 @@ const y = {
19
19
  default: !1
20
20
  }
21
21
  }, c = {
22
- props: y
22
+ props: C
23
23
  };
24
- var $ = Object.defineProperty, g = Object.getOwnPropertyDescriptor, i = (t, s, r, o) => {
25
- for (var a = o > 1 ? void 0 : o ? g(s, r) : s, n = t.length - 1, d; n >= 0; n--)
26
- (d = t[n]) && (a = (o ? d(s, r, a) : d(a)) || a);
27
- return o && a && $(s, r, a), a;
24
+ var $ = Object.defineProperty, g = Object.getOwnPropertyDescriptor, i = (t, s, l, o) => {
25
+ for (var r = o > 1 ? void 0 : o ? g(s, l) : s, n = t.length - 1, d; n >= 0; n--)
26
+ (d = t[n]) && (r = (o ? d(s, l, r) : d(r)) || r);
27
+ return o && r && $(s, l, r), r;
28
28
  };
29
29
  let e = class extends f {
30
30
  constructor() {
31
- super(), this.defaultSlot = _(), this.compact = c.props.compact.default, this.title = "", this.skin = c.props.skin.default, this.ariaLive = c.props.ariaLive.default, this["aria-live"] = null, this.closeAlert = c.props.closeAlert.default, this.date = null, this._isClosed = !1, this.close = (t) => {
31
+ super(), this.defaultSlot = _(), this.compact = c.props.compact.default, this.title = "", this.skin = c.props.skin.default, this.ariaLive = c.props.ariaLive.default, this["aria-live"] = null, this.closeAlert = c.props.closeAlert.default, this.date = null, this.role = "status", this._isClosed = !1, this.close = (t) => {
32
32
  this._isClosed = !0, this.dispatchEvent(
33
33
  new CustomEvent("close", { detail: { origin: t }, bubbles: !0, composed: !0 })
34
34
  ), this.dispatchEvent(
@@ -40,11 +40,11 @@ let e = class extends f {
40
40
  connectedCallback() {
41
41
  super.connectedCallback(), this["aria-live"] = this.getAttribute("aria-live") || this.ariaLive;
42
42
  }
43
- attributeChangedCallback(t, s, r) {
44
- t === "ariaLive" && (this["aria-live"] = r), super.attributeChangedCallback(t, s, r);
43
+ attributeChangedCallback(t, s, l) {
44
+ t === "ariaLive" && (this["aria-live"] = l), super.attributeChangedCallback(t, s, l);
45
45
  }
46
46
  updated(t) {
47
- super.updated(t), t.has("ariaLive") && (this["aria-live"] = this.ariaLive), t.has("_isClosed") && C(this, "pkt-hide", this._isClosed);
47
+ super.updated(t), t.has("ariaLive") && (this["aria-live"] = this.ariaLive), t.has("_isClosed") && y(this, "pkt-hide", this._isClosed);
48
48
  }
49
49
  // Render
50
50
  render() {
@@ -59,7 +59,7 @@ let e = class extends f {
59
59
  "pkt-alert__noDate": !this.date
60
60
  };
61
61
  return p`
62
- <div class=${u(t)}>
62
+ <div class=${u(t)} aria-live=${this["aria-live"]}>
63
63
  <div class=${u(s)}>
64
64
  <pkt-icon
65
65
  class="pkt-alert__icon"
@@ -93,26 +93,29 @@ let e = class extends f {
93
93
  }
94
94
  };
95
95
  i([
96
- l({ type: Boolean, reflect: !1 })
96
+ a({ type: Boolean, reflect: !1 })
97
97
  ], e.prototype, "compact", 2);
98
98
  i([
99
- l({ type: String, reflect: !0 })
99
+ a({ type: String, reflect: !0 })
100
100
  ], e.prototype, "title", 2);
101
101
  i([
102
- l({ type: String, reflect: !0 })
102
+ a({ type: String, reflect: !0 })
103
103
  ], e.prototype, "skin", 2);
104
104
  i([
105
- l({ type: String })
105
+ a({ type: String })
106
106
  ], e.prototype, "ariaLive", 2);
107
107
  i([
108
- l({ type: String, reflect: !0 })
108
+ a({ type: String, reflect: !0 })
109
109
  ], e.prototype, "aria-live", 2);
110
110
  i([
111
- l({ type: Boolean, reflect: !0 })
111
+ a({ type: Boolean, reflect: !0 })
112
112
  ], e.prototype, "closeAlert", 2);
113
113
  i([
114
- l({ type: String, reflect: !0 })
114
+ a({ type: String, reflect: !0 })
115
115
  ], e.prototype, "date", 2);
116
+ i([
117
+ a({ type: String, reflect: !0 })
118
+ ], e.prototype, "role", 2);
116
119
  i([
117
120
  k()
118
121
  ], e.prototype, "_isClosed", 2);