@oslokommune/punkt-react 13.6.3 → 13.6.5
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 +18 -0
- package/dist/punkt-react.es.js +20 -2
- package/dist/punkt-react.umd.js +1 -1
- package/package.json +4 -4
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
|
+
## [13.6.4](https://github.com/oslokommune/punkt/compare/13.6.3...13.6.4) (2025-09-19)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
* Update Heading-component (#2997).
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
Ingen
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
|
|
8
26
|
## [13.5.13](https://github.com/oslokommune/punkt/compare/13.5.12...13.5.13) (2025-09-12)
|
|
9
27
|
|
|
10
28
|
### ⚠ BREAKING CHANGES
|
package/dist/punkt-react.es.js
CHANGED
|
@@ -4256,7 +4256,7 @@ var WN = Object.defineProperty, YN = Object.getOwnPropertyDescriptor, Mi = (e, t
|
|
|
4256
4256
|
};
|
|
4257
4257
|
let jn = class extends Qs {
|
|
4258
4258
|
constructor() {
|
|
4259
|
-
super(...arguments), this.size =
|
|
4259
|
+
super(...arguments), this.size = void 0, this.level = 2, this.visuallyHidden = !1, this.align = void 0;
|
|
4260
4260
|
}
|
|
4261
4261
|
connectedCallback() {
|
|
4262
4262
|
super.connectedCallback(), this.setAttribute("role", "heading"), this.setAttribute("aria-level", String(this.level)), this.updateHostClasses();
|
|
@@ -4265,11 +4265,29 @@ let jn = class extends Qs {
|
|
|
4265
4265
|
super.attributeChangedCallback(t, r, n), t === "level" && n && this.setLevel(Number(n)), t === "visuallyHidden" && (this.visuallyHidden = n !== null && n !== "false"), (t === "size" || t === "visuallyHidden" || t === "align") && this.updateHostClasses();
|
|
4266
4266
|
}
|
|
4267
4267
|
updated(t) {
|
|
4268
|
-
super.updated(t), t.has("level") && this.setLevel(this.level), (t.has("size") || t.has("visuallyHidden") || t.has("align")) && this.updateHostClasses();
|
|
4268
|
+
super.updated(t), t.has("level") && (this.setLevel(this.level), this.hasAttribute("size") || (this.size = this.defaultSizeForLevel)), !this.hasAttribute("size") && (t.has("level") || this.size === void 0) && (this.size = this.defaultSizeForLevel), (t.has("size") || t.has("visuallyHidden") || t.has("align")) && this.updateHostClasses();
|
|
4269
4269
|
}
|
|
4270
4270
|
setLevel(t) {
|
|
4271
4271
|
t >= 1 && t <= 6 ? (this.level = t, this.setAttribute("aria-level", String(t))) : console.warn(`Invalid heading level: ${t}. Must be between 1 and 6.`);
|
|
4272
4272
|
}
|
|
4273
|
+
get defaultSizeForLevel() {
|
|
4274
|
+
switch (this.level) {
|
|
4275
|
+
case 1:
|
|
4276
|
+
return "xlarge";
|
|
4277
|
+
case 2:
|
|
4278
|
+
return "large";
|
|
4279
|
+
case 3:
|
|
4280
|
+
return "medium";
|
|
4281
|
+
case 4:
|
|
4282
|
+
return "small";
|
|
4283
|
+
case 5:
|
|
4284
|
+
return "xsmall";
|
|
4285
|
+
case 6:
|
|
4286
|
+
return "xsmall";
|
|
4287
|
+
default:
|
|
4288
|
+
return "medium";
|
|
4289
|
+
}
|
|
4290
|
+
}
|
|
4273
4291
|
updateHostClasses() {
|
|
4274
4292
|
this.classList.remove(
|
|
4275
4293
|
"pkt-heading",
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -354,7 +354,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
354
354
|
${this.iconName&&M`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
355
355
|
<span ${be(this.defaultSlot)}></span>
|
|
356
356
|
</span>
|
|
357
|
-
`}};Cr([_({type:Boolean,reflect:!0})],pr.prototype,"closeTag",2),Cr([_({type:String,reflect:!0})],pr.prototype,"size",2),Cr([_({type:String,reflect:!0})],pr.prototype,"skin",2),Cr([_({type:String,reflect:!0})],pr.prototype,"textStyle",2),Cr([_({type:String,reflect:!0})],pr.prototype,"iconName",2),Cr([_({type:String})],pr.prototype,"type",2),Cr([_({type:String})],pr.prototype,"ariaLabel",2),Cr([Oe()],pr.prototype,"_isClosed",2),Cr([Oe()],pr.prototype,"_ariaDescription",2),pr=Cr([Ue("pkt-tag")],pr);var nT=Object.defineProperty,aT=Object.getOwnPropertyDescriptor,ui=(e,t,r,n)=>{for(var a=n>1?void 0:n?aT(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(a=(n?o(t,r,a):o(a))||a);return n&&a&&nT(t,r,a),a};let xn=class extends os{constructor(){super(...arguments),this.size=
|
|
357
|
+
`}};Cr([_({type:Boolean,reflect:!0})],pr.prototype,"closeTag",2),Cr([_({type:String,reflect:!0})],pr.prototype,"size",2),Cr([_({type:String,reflect:!0})],pr.prototype,"skin",2),Cr([_({type:String,reflect:!0})],pr.prototype,"textStyle",2),Cr([_({type:String,reflect:!0})],pr.prototype,"iconName",2),Cr([_({type:String})],pr.prototype,"type",2),Cr([_({type:String})],pr.prototype,"ariaLabel",2),Cr([Oe()],pr.prototype,"_isClosed",2),Cr([Oe()],pr.prototype,"_ariaDescription",2),pr=Cr([Ue("pkt-tag")],pr);var nT=Object.defineProperty,aT=Object.getOwnPropertyDescriptor,ui=(e,t,r,n)=>{for(var a=n>1?void 0:n?aT(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(a=(n?o(t,r,a):o(a))||a);return n&&a&&nT(t,r,a),a};let xn=class extends os{constructor(){super(...arguments),this.size=void 0,this.level=2,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(t,r,n){super.attributeChangedCallback(t,r,n),t==="level"&&n&&this.setLevel(Number(n)),t==="visuallyHidden"&&(this.visuallyHidden=n!==null&&n!=="false"),(t==="size"||t==="visuallyHidden"||t==="align")&&this.updateHostClasses()}updated(t){super.updated(t),t.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel)),!this.hasAttribute("size")&&(t.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(t.has("size")||t.has("visuallyHidden")||t.has("align"))&&this.updateHostClasses()}setLevel(t){t>=1&&t<=6?(this.level=t,this.setAttribute("aria-level",String(t))):console.warn(`Invalid heading level: ${t}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return M`<slot></slot>`}};ui([_({type:String,reflect:!0})],xn.prototype,"size",2),ui([_({type:Number,reflect:!0})],xn.prototype,"level",2),ui([_({type:Boolean,reflect:!0})],xn.prototype,"visuallyHidden",2),ui([_({type:String,reflect:!0})],xn.prototype,"align",2),xn=ui([Ue("pkt-heading")],xn);const iT={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},ua={props:iT};var sT=Object.defineProperty,oT=Object.getOwnPropertyDescriptor,Tt=(e,t,r,n)=>{for(var a=n>1?void 0:n?oT(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(a=(n?o(t,r,a):o(a))||a);return n&&a&&sT(t,r,a),a};let Et=class extends ct{constructor(){super(),this.defaultSlot=Se(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=ua.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=ua.props.padding.default,this.skin=ua.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new Dt(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var t,r;const n={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},a=((t=this.ariaLabel)==null?void 0:t.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),i=((r=this.ariaLabel)==null?void 0:r.trim())||(this.heading?this.heading:"kort");return M`
|
|
358
358
|
<article
|
|
359
359
|
class=${ge(n)}
|
|
360
360
|
aria-label=${de(this.clickCardLink?a:i)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "13.6.
|
|
3
|
+
"version": "13.6.5",
|
|
4
4
|
"description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@lit-labs/ssr-dom-shim": "^1.2.1",
|
|
40
40
|
"@lit/react": "^1.0.7",
|
|
41
|
-
"@oslokommune/punkt-elements": "^13.6.
|
|
41
|
+
"@oslokommune/punkt-elements": "^13.6.5",
|
|
42
42
|
"prettier": "^3.3.3",
|
|
43
43
|
"react-element-to-jsx-string": "^15.0.0",
|
|
44
44
|
"react-hook-form": "^7.53.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@babel/plugin-transform-private-property-in-object": "^7.25.9",
|
|
49
49
|
"@oslokommune/punkt-assets": "^13.6.3",
|
|
50
|
-
"@oslokommune/punkt-css": "^13.6.
|
|
50
|
+
"@oslokommune/punkt-css": "^13.6.5",
|
|
51
51
|
"@testing-library/jest-dom": "^6.5.0",
|
|
52
52
|
"@testing-library/react": "^16.0.1",
|
|
53
53
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
111
111
|
},
|
|
112
112
|
"license": "MIT",
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "ffe29e4d76b6c7b968e469b4402f1d8e152392cf"
|
|
114
114
|
}
|