@oslokommune/punkt-react 12.39.7 → 12.40.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 +18 -0
- package/dist/index.d.ts +2 -2
- package/dist/punkt-react.es.js +14 -14
- package/dist/punkt-react.umd.js +12 -12
- package/package.json +4 -4
- package/src/components/card/Card.tsx +2 -2
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
|
+
## [12.39.8](https://github.com/oslokommune/punkt/compare/12.39.7...12.39.8) (2025-05-19)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
* new, generic prop names for author and date (#2563).
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
Ingen
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
|
|
8
26
|
## [12.39.7](https://github.com/oslokommune/punkt/compare/12.39.6...12.39.7) (2025-05-16)
|
|
9
27
|
|
|
10
28
|
### ⚠ BREAKING CHANGES
|
package/dist/index.d.ts
CHANGED
|
@@ -123,9 +123,9 @@ export declare interface IPktButton extends ExtendedButton {
|
|
|
123
123
|
|
|
124
124
|
export declare interface IPktCard extends PktElType {
|
|
125
125
|
ariaLabel?: string;
|
|
126
|
-
|
|
126
|
+
metaLead?: string | null;
|
|
127
127
|
borderOnHover?: boolean | null;
|
|
128
|
-
|
|
128
|
+
metaTrail?: string | null;
|
|
129
129
|
direction?: TDirection;
|
|
130
130
|
heading?: string;
|
|
131
131
|
headingLevel?: IPktHeading['level'];
|
package/dist/punkt-react.es.js
CHANGED
|
@@ -22753,7 +22753,7 @@ var HL = Object.defineProperty, qL = Object.getOwnPropertyDescriptor, _y = (r, n
|
|
|
22753
22753
|
return l && d && HL(n, i, d), d;
|
|
22754
22754
|
};
|
|
22755
22755
|
window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch;
|
|
22756
|
-
window.pktIconPath = window.pktIconPath || "https://punkt-cdn.oslo.kommune.no/12.
|
|
22756
|
+
window.pktIconPath = window.pktIconPath || "https://punkt-cdn.oslo.kommune.no/12.40/icons/";
|
|
22757
22757
|
const VL = (r) => new Promise((n) => setTimeout(n, r)), rw = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>', HD = {}, WL = async (r, n) => {
|
|
22758
22758
|
let i = 0;
|
|
22759
22759
|
for (; HD[n + r + ".svg"] === "fetching" && (i++, !(i > 50)); )
|
|
@@ -23068,7 +23068,7 @@ var aB = Object.defineProperty, iB = Object.getOwnPropertyDescriptor, Ds = (r, n
|
|
|
23068
23068
|
(m = r[h]) && (d = (l ? m(n, i, d) : m(d)) || d);
|
|
23069
23069
|
return l && d && aB(n, i, d), d;
|
|
23070
23070
|
};
|
|
23071
|
-
window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/12.
|
|
23071
|
+
window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/12.40/animations/";
|
|
23072
23072
|
let qi = class extends Gr {
|
|
23073
23073
|
constructor() {
|
|
23074
23074
|
super(), this.internals = this.attachInternals(), this.defaultSlot = dn(), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.isLoading = !1, this.disabled = !1, this.loadingAnimationPath = window.pktAnimationPath, this.slotController = new za(this, this.defaultSlot), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeydown);
|
|
@@ -25211,7 +25211,7 @@ var FM = Object.defineProperty, $M = Object.getOwnPropertyDescriptor, ki = (r, n
|
|
|
25211
25211
|
let ja = class extends Gr {
|
|
25212
25212
|
//Constructor
|
|
25213
25213
|
constructor() {
|
|
25214
|
-
super(), this.defaultSlot = dn(), this.ariaLabel = "", this.
|
|
25214
|
+
super(), this.defaultSlot = dn(), this.ariaLabel = "", this.metaLead = null, this.borderOnHover = !0, this.clickCardLink = null, this.metaTrail = null, this.direction = GD.props.direction.default, this.heading = "", this.headinglevel = 3, this.image = {
|
|
25215
25215
|
src: "",
|
|
25216
25216
|
alt: ""
|
|
25217
25217
|
}, this.imageShape = "square", this.openLinkInNewTab = !1, this.padding = GD.props.padding.default, this.skin = GD.props.skin.default, this.subheading = "", this.tagPosition = "top", this.tags = [], this.slotController = new za(this, this.defaultSlot);
|
|
@@ -25242,7 +25242,7 @@ let ja = class extends Gr {
|
|
|
25242
25242
|
${this.renderHeader()}
|
|
25243
25243
|
${this.renderSlot()}
|
|
25244
25244
|
${this.tagPosition === "bottom" ? this.renderTags() : Ve}
|
|
25245
|
-
${this.
|
|
25245
|
+
${this.renderMetadata()}
|
|
25246
25246
|
</div>
|
|
25247
25247
|
</article>
|
|
25248
25248
|
`;
|
|
@@ -25349,12 +25349,12 @@ let ja = class extends Gr {
|
|
|
25349
25349
|
${this.defaultSlot && be`<section class="pkt-card__content" ${Kt(this.defaultSlot)}></section>`}
|
|
25350
25350
|
`;
|
|
25351
25351
|
}
|
|
25352
|
-
|
|
25352
|
+
renderMetadata() {
|
|
25353
25353
|
return be`
|
|
25354
|
-
${this.
|
|
25355
|
-
<footer class="pkt-
|
|
25356
|
-
${this.
|
|
25357
|
-
${this.
|
|
25354
|
+
${this.metaLead || this.metaTrail ? be`
|
|
25355
|
+
<footer class="pkt-card__metadata">
|
|
25356
|
+
${this.metaLead ? be`<span class="pkt-card__metadata-lead">${this.metaLead}</span>` : Ve}
|
|
25357
|
+
${this.metaTrail ? be`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>` : Ve}
|
|
25358
25358
|
</footer>
|
|
25359
25359
|
` : Ve}
|
|
25360
25360
|
`;
|
|
@@ -25365,7 +25365,7 @@ ki([
|
|
|
25365
25365
|
], ja.prototype, "ariaLabel", 2);
|
|
25366
25366
|
ki([
|
|
25367
25367
|
z({ type: String })
|
|
25368
|
-
], ja.prototype, "
|
|
25368
|
+
], ja.prototype, "metaLead", 2);
|
|
25369
25369
|
ki([
|
|
25370
25370
|
z({ type: Boolean })
|
|
25371
25371
|
], ja.prototype, "borderOnHover", 2);
|
|
@@ -25374,7 +25374,7 @@ ki([
|
|
|
25374
25374
|
], ja.prototype, "clickCardLink", 2);
|
|
25375
25375
|
ki([
|
|
25376
25376
|
z({ type: String })
|
|
25377
|
-
], ja.prototype, "
|
|
25377
|
+
], ja.prototype, "metaTrail", 2);
|
|
25378
25378
|
ki([
|
|
25379
25379
|
z({ type: String })
|
|
25380
25380
|
], ja.prototype, "direction", 2);
|
|
@@ -27692,7 +27692,7 @@ var oI = Object.defineProperty, sI = Object.getOwnPropertyDescriptor, fd = (r, n
|
|
|
27692
27692
|
(m = r[h]) && (d = (l ? m(n, i, d) : m(d)) || d);
|
|
27693
27693
|
return l && d && oI(n, i, d), d;
|
|
27694
27694
|
};
|
|
27695
|
-
window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/12.
|
|
27695
|
+
window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/12.40/animations/";
|
|
27696
27696
|
let iu = class extends Gr {
|
|
27697
27697
|
constructor() {
|
|
27698
27698
|
super(), this.defaultSlot = dn(), this.delay = 0, this.inline = !1, this.isLoading = !0, this.message = null, this.size = "medium", this.variant = "shapes", this.loadingAnimationPath = window.pktAnimationPath, this._shouldDisplayLoader = !1, this.slotController = new za(this, this.defaultSlot);
|
|
@@ -29102,7 +29102,7 @@ const ou = /* @__PURE__ */ Dw(UI), ZH = Ir(
|
|
|
29102
29102
|
name: "oslologo",
|
|
29103
29103
|
className: "pkt-header__logo-svg",
|
|
29104
29104
|
"aria-hidden": "true",
|
|
29105
|
-
path: "https://punkt-cdn.oslo.kommune.no/12.
|
|
29105
|
+
path: "https://punkt-cdn.oslo.kommune.no/12.40/logos/"
|
|
29106
29106
|
}
|
|
29107
29107
|
) }) : /* @__PURE__ */ L.jsx(
|
|
29108
29108
|
"button",
|
|
@@ -29116,7 +29116,7 @@ const ou = /* @__PURE__ */ Dw(UI), ZH = Ir(
|
|
|
29116
29116
|
name: "oslologo",
|
|
29117
29117
|
className: "pkt-header__logo-svg",
|
|
29118
29118
|
"aria-hidden": "true",
|
|
29119
|
-
path: "https://punkt-cdn.oslo.kommune.no/12.
|
|
29119
|
+
path: "https://punkt-cdn.oslo.kommune.no/12.40/logos/"
|
|
29120
29120
|
}
|
|
29121
29121
|
)
|
|
29122
29122
|
}
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -335,7 +335,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
335
335
|
* @license
|
|
336
336
|
* Copyright 2017 Google LLC
|
|
337
337
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
338
|
-
*/let i0=class extends Yy{};i0.directiveName="unsafeSVG",i0.resultType=2;const w1=Of(i0);var xP=Object.defineProperty,EP=Object.getOwnPropertyDescriptor,Tg=(n,r,i,l)=>{for(var c=l>1?void 0:l?EP(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&xP(r,i,c),c};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/12.
|
|
338
|
+
*/let i0=class extends Yy{};i0.directiveName="unsafeSVG",i0.resultType=2;const w1=Of(i0);var xP=Object.defineProperty,EP=Object.getOwnPropertyDescriptor,Tg=(n,r,i,l)=>{for(var c=l>1?void 0:l?EP(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&xP(r,i,c),c};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/12.40/icons/";const TP=n=>new Promise(r=>setTimeout(r,n)),Ky='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',o0={},AP=async(n,r)=>{let i=0;for(;o0[r+n+".svg"]==="fetching"&&(i++,!(i>50));)await TP(50);return localStorage.getItem(r+n+".svg")?Promise.resolve(localStorage.getItem(r+n+".svg")):typeof window.pktFetch=="function"?(o0[r+n+".svg"]="fetching",Promise.resolve(window.pktFetch(r+n+".svg").then(l=>l.ok?l.text():(console.error("Missing icon: "+r+n+".svg"),Ky)).then(l=>(l!==Ky&&localStorage.setItem(r+n+".svg",l),o0[r+n+".svg"]="fetched",l)))):Promise.resolve(Ky)};let Lf=class extends Hr{constructor(){super(...arguments),this.path=window.pktIconPath,this.name="",this.icon=w1(Ky),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(r,i,l){super.attributeChangedCallback(r,i,l),(r==="name"||r==="path")&&this.getIcon(this.name)}async updated(r){super.updated(r),(r.has("name")||r.has("path"))&&this.getIcon(this.name)}async getIcon(r=""){this._updatedProps.length>0?(this.path||(this.path,window.pktIconPath),this.icon=w1(await AP(this.name||"",this.path).then(i=>i)),this._updatedProps=[]):this._updatedProps.includes(r)||this._updatedProps.push(r)}render(){return be`${this.name&&this.icon}`}};Tg([z({type:String,reflect:!1})],Lf.prototype,"path",2),Tg([z({type:String,reflect:!0})],Lf.prototype,"name",2),Tg([z({type:SVGElement})],Lf.prototype,"icon",2),Tg([z({type:Array,noAccessor:!0})],Lf.prototype,"_updatedProps",2),Lf=Tg([dr("pkt-icon")],Lf);const FP={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},Qy={props:FP};var $P=Object.defineProperty,PP=Object.getOwnPropertyDescriptor,pc=(n,r,i,l)=>{for(var c=l>1?void 0:l?PP(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&$P(r,i,c),c};let dl=class extends Hr{constructor(){super(),this.defaultSlot=dn(),this.compact=Qy.props.compact.default,this.title="",this.skin=Qy.props.skin.default,this.ariaLive=Qy.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=Qy.props.closeAlert.default,this.date=null,this._isClosed=!1,this.close=r=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:r},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:r},bubbles:!0,composed:!0}))},this.slotController=new _a(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(r,i,l){r==="ariaLive"&&(this["aria-live"]=l),super.attributeChangedCallback(r,i,l)}updated(r){super.updated(r),r.has("ariaLive")&&(this["aria-live"]=this.ariaLive),r.has("_isClosed")&&k1(this,"pkt-hide",this._isClosed)}render(){const r={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},i={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return be`
|
|
339
339
|
<div class=${It(r)}>
|
|
340
340
|
<div class=${It(i)}>
|
|
341
341
|
<pkt-icon
|
|
@@ -414,7 +414,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
414
414
|
></pkt-icon
|
|
415
415
|
><span class="pkt-back-link__text">${this.text}</span></a
|
|
416
416
|
>
|
|
417
|
-
</nav>`}};Jy([z({type:String,reflect:!0})],Ch.prototype,"href",2),Jy([z({type:String,reflect:!0})],Ch.prototype,"text",2),Jy([z({type:String,reflect:!0})],Ch.prototype,"ariaLabel",2),Ch=Jy([dr("pkt-backlink")],Ch);var zP=Object.defineProperty,UP=Object.getOwnPropertyDescriptor,Go=(n,r,i,l)=>{for(var c=l>1?void 0:l?UP(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&zP(r,i,c),c};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/12.
|
|
417
|
+
</nav>`}};Jy([z({type:String,reflect:!0})],Ch.prototype,"href",2),Jy([z({type:String,reflect:!0})],Ch.prototype,"text",2),Jy([z({type:String,reflect:!0})],Ch.prototype,"ariaLabel",2),Ch=Jy([dr("pkt-backlink")],Ch);var zP=Object.defineProperty,UP=Object.getOwnPropertyDescriptor,Go=(n,r,i,l)=>{for(var c=l>1?void 0:l?UP(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&zP(r,i,c),c};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/12.40/animations/";let Di=class extends Hr{constructor(){super(),this.internals=this.attachInternals(),this.defaultSlot=dn(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new _a(this,this.defaultSlot),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeydown)}attributeChangedCallback(r,i,l){super.attributeChangedCallback(r,i,l),r==="disabled"&&l==="false"&&(this.disabled=!1),(r==="isloading"||r==="isLoading")&&l==="false"&&(this.isLoading=!1)}firstUpdated(r){super.firstUpdated(r),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}updated(r){super.updated(r),this.setAttribute("role","button"),this.internals.role="button",this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1),this.disabled?(this.getAttribute("tabindex")!=="-1"&&this.setAttribute("tabindex","-1"),this.getAttribute("aria-disabled")!=="true"&&this.setAttribute("aria-disabled","true")):(this.getAttribute("tabindex")!=="0"&&this.setAttribute("tabindex","0"),this.getAttribute("aria-disabled")!=="false"&&this.removeAttribute("aria-disabled")),this.isLoading?this.getAttribute("aria-busy")!=="true"&&this.setAttribute("aria-busy","true"):this.hasAttribute("aria-busy")&&this.removeAttribute("aria-busy"),this.updateElementClasses()}render(){return be`
|
|
418
418
|
<div class="pkt-contents">
|
|
419
419
|
${this.isLoading?be`<pkt-icon
|
|
420
420
|
class="pkt-btn__icon pkt-btn__spinner"
|
|
@@ -549,7 +549,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
549
549
|
${this.iconName&&be`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
550
550
|
<span ${qt(this.defaultSlot)}></span>
|
|
551
551
|
</span>
|
|
552
|
-
`}};cu([z({type:Boolean,reflect:!0})],xs.prototype,"closeTag",2),cu([z({type:String,reflect:!0})],xs.prototype,"size",2),cu([z({type:String,reflect:!0})],xs.prototype,"skin",2),cu([z({type:String,reflect:!0})],xs.prototype,"textStyle",2),cu([z({type:String,reflect:!0})],xs.prototype,"iconName",2),cu([z({type:String})],xs.prototype,"type",2),cu([z({type:String})],xs.prototype,"ariaLabel",2),cu([$n()],xs.prototype,"_isClosed",2),cu([$n()],xs.prototype,"_ariaDescription",2),xs=cu([dr("pkt-tag")],xs);const f3={skin:{default:"outlined"},direction:{default:"portrait"},padding:{default:"standard"}},p0={props:f3};var p3=Object.defineProperty,h3=Object.getOwnPropertyDescriptor,ri=(n,r,i,l)=>{for(var c=l>1?void 0:l?h3(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&p3(r,i,c),c};let xa=class extends Hr{constructor(){super(),this.defaultSlot=dn(),this.ariaLabel="",this.
|
|
552
|
+
`}};cu([z({type:Boolean,reflect:!0})],xs.prototype,"closeTag",2),cu([z({type:String,reflect:!0})],xs.prototype,"size",2),cu([z({type:String,reflect:!0})],xs.prototype,"skin",2),cu([z({type:String,reflect:!0})],xs.prototype,"textStyle",2),cu([z({type:String,reflect:!0})],xs.prototype,"iconName",2),cu([z({type:String})],xs.prototype,"type",2),cu([z({type:String})],xs.prototype,"ariaLabel",2),cu([$n()],xs.prototype,"_isClosed",2),cu([$n()],xs.prototype,"_ariaDescription",2),xs=cu([dr("pkt-tag")],xs);const f3={skin:{default:"outlined"},direction:{default:"portrait"},padding:{default:"standard"}},p0={props:f3};var p3=Object.defineProperty,h3=Object.getOwnPropertyDescriptor,ri=(n,r,i,l)=>{for(var c=l>1?void 0:l?h3(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&p3(r,i,c),c};let xa=class extends Hr{constructor(){super(),this.defaultSlot=dn(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.direction=p0.props.direction.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=p0.props.padding.default,this.skin=p0.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new _a(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var r,i;const l={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.direction}`]:this.direction,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},c=((r=this.ariaLabel)==null?void 0:r.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),h=((i=this.ariaLabel)==null?void 0:i.trim())||(this.heading?this.heading:"kort");return be`
|
|
553
553
|
<article
|
|
554
554
|
class=${It(l)}
|
|
555
555
|
aria-label=${Cn(this.clickCardLink?c:h)}
|
|
@@ -560,7 +560,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
560
560
|
${this.renderHeader()}
|
|
561
561
|
${this.renderSlot()}
|
|
562
562
|
${this.tagPosition==="bottom"?this.renderTags():qe}
|
|
563
|
-
${this.
|
|
563
|
+
${this.renderMetadata()}
|
|
564
564
|
</div>
|
|
565
565
|
</article>
|
|
566
566
|
`}renderImage(){const r={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return be`
|
|
@@ -628,14 +628,14 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
628
628
|
`:qe}
|
|
629
629
|
`}renderSlot(){return be`
|
|
630
630
|
${this.defaultSlot&&be`<section class="pkt-card__content" ${qt(this.defaultSlot)}></section>`}
|
|
631
|
-
`}
|
|
632
|
-
${this.
|
|
633
|
-
<footer class="pkt-
|
|
634
|
-
${this.
|
|
635
|
-
${this.
|
|
631
|
+
`}renderMetadata(){return be`
|
|
632
|
+
${this.metaLead||this.metaTrail?be`
|
|
633
|
+
<footer class="pkt-card__metadata">
|
|
634
|
+
${this.metaLead?be`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:qe}
|
|
635
|
+
${this.metaTrail?be`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:qe}
|
|
636
636
|
</footer>
|
|
637
637
|
`:qe}
|
|
638
|
-
`}};ri([z({type:String})],xa.prototype,"ariaLabel",2),ri([z({type:String})],xa.prototype,"
|
|
638
|
+
`}};ri([z({type:String})],xa.prototype,"ariaLabel",2),ri([z({type:String})],xa.prototype,"metaLead",2),ri([z({type:Boolean})],xa.prototype,"borderOnHover",2),ri([z({type:String,reflect:!0})],xa.prototype,"clickCardLink",2),ri([z({type:String})],xa.prototype,"metaTrail",2),ri([z({type:String})],xa.prototype,"direction",2),ri([z({type:String})],xa.prototype,"heading",2),ri([z({type:Number})],xa.prototype,"headinglevel",2),ri([z({type:Object})],xa.prototype,"image",2),ri([z({type:String})],xa.prototype,"imageShape",2),ri([z({type:Boolean})],xa.prototype,"openLinkInNewTab",2),ri([z({type:String})],xa.prototype,"padding",2),ri([z({type:String})],xa.prototype,"skin",2),ri([z({type:String})],xa.prototype,"subheading",2),ri([z({type:String})],xa.prototype,"tagPosition",2),ri([z({type:Array})],xa.prototype,"tags",2),xa=ri([dr("pkt-card")],xa);/**
|
|
639
639
|
* @license
|
|
640
640
|
* Copyright 2017 Google LLC
|
|
641
641
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1126,7 +1126,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
1126
1126
|
|
|
1127
1127
|
<div class="pkt-linkcard__text" ${qt(this.defaultSlot)}></div>
|
|
1128
1128
|
</a>
|
|
1129
|
-
`}};Uf([z({type:String,reflect:!0})],hc.prototype,"title",2),Uf([z({type:String,reflect:!0})],hc.prototype,"href",2),Uf([z({type:String,reflect:!0})],hc.prototype,"iconName",2),Uf([z({type:Boolean,reflect:!0})],hc.prototype,"external",2),Uf([z({type:Boolean,reflect:!0})],hc.prototype,"openInNewTab",2),Uf([z({type:String,reflect:!0})],hc.prototype,"skin",2),hc=Uf([dr("pkt-linkcard")],hc);var H3=Object.defineProperty,V3=Object.getOwnPropertyDescriptor,mc=(n,r,i,l)=>{for(var c=l>1?void 0:l?V3(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&H3(r,i,c),c};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/12.
|
|
1129
|
+
`}};Uf([z({type:String,reflect:!0})],hc.prototype,"title",2),Uf([z({type:String,reflect:!0})],hc.prototype,"href",2),Uf([z({type:String,reflect:!0})],hc.prototype,"iconName",2),Uf([z({type:Boolean,reflect:!0})],hc.prototype,"external",2),Uf([z({type:Boolean,reflect:!0})],hc.prototype,"openInNewTab",2),Uf([z({type:String,reflect:!0})],hc.prototype,"skin",2),hc=Uf([dr("pkt-linkcard")],hc);var H3=Object.defineProperty,V3=Object.getOwnPropertyDescriptor,mc=(n,r,i,l)=>{for(var c=l>1?void 0:l?V3(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&H3(r,i,c),c};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/12.40/animations/";let pl=class extends Hr{constructor(){super(),this.defaultSlot=dn(),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1,this.slotController=new _a(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(r){r.has("delay")&&this.setupLoader()}render(){const r=It({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),i=It({"pkt-contents":!0,"pkt-hide":this.isLoading});return be`<div role="status" aria-live="polite" .aria-busy=${this.isLoading} class=${r}>
|
|
1130
1130
|
${this.isLoading&&this._shouldDisplayLoader?be`<div class="pkt-loader__spinner">
|
|
1131
1131
|
<pkt-icon
|
|
1132
1132
|
name=${this.getVariant(this.variant)}
|
|
@@ -1419,7 +1419,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
1419
1419
|
Copyright (c) 2018 Jed Watson.
|
|
1420
1420
|
Licensed under the MIT License (MIT), see
|
|
1421
1421
|
http://jedwatson.github.io/classnames
|
|
1422
|
-
*/(function(n){(function(){var r={}.hasOwnProperty;function i(){for(var h="",m=0;m<arguments.length;m++){var D=arguments[m];D&&(h=c(h,l(D)))}return h}function l(h){if(typeof h=="string"||typeof h=="number")return h;if(typeof h!="object")return"";if(Array.isArray(h))return i.apply(null,h);if(h.toString!==Object.prototype.toString&&!h.toString.toString().includes("[native code]"))return h.toString();var m="";for(var D in h)r.call(h,D)&&h[D]&&(m=c(m,D));return m}function c(h,m){return m?h?h+" "+m:h+m:h}n.exports?(i.default=i,n.exports=i):window.classNames=i})()})(e_);var DO=e_.exports;const ml=By(DO),SO=$e.forwardRef(({className:n,logoLink:r="https://www.oslo.kommune.no/",serviceName:i,fixed:l=!0,scrollToHide:c=!0,user:h,userMenu:m,representing:D,userOptions:C,userMenuFooter:T,canChangeRepresentation:$=!0,showMenuButton:N=!1,showLogOutButton:O=!1,openMenu:B,logOut:I,changeRepresentation:K,children:Y,...Ce},J)=>{const G=$e.useMemo(()=>typeof(h==null?void 0:h.lastLoggedIn)=="string"?h.lastLoggedIn:h!=null&&h.lastLoggedIn?new Date(h.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[h]),[re,V]=$e.useState(!1),[ae,ce]=$e.useState(0),[Te,ke]=$e.useState(!1),Ge=$e.useRef(null);$e.useEffect(()=>(document&&(document.addEventListener("mouseup",Ke),window.addEventListener("scroll",nt)),()=>{document&&(document.removeEventListener("mouseup",Ke),window.removeEventListener("scroll",nt))}));const We=()=>{ke(!Te)},Ke=He=>{Ge.current&&!Ge.current.contains(He.target)&&ke(!1)},nt=()=>{if(c){const He=window.pageYOffset||document.documentElement.scrollTop;if(He<0||Math.abs(He-ae)<60)return;V(He>ae),ce(He)}};return L.jsxs("header",{...Ce,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:ml(n,"pkt-header",{"pkt-header--fixed":l,"pkt-header--scroll-to-hide":c,"pkt-header--hidden":re}),ref:J,children:[L.jsxs("div",{className:"pkt-header__logo",children:[typeof r=="string"?L.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:r,children:L.jsx(br,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.
|
|
1422
|
+
*/(function(n){(function(){var r={}.hasOwnProperty;function i(){for(var h="",m=0;m<arguments.length;m++){var D=arguments[m];D&&(h=c(h,l(D)))}return h}function l(h){if(typeof h=="string"||typeof h=="number")return h;if(typeof h!="object")return"";if(Array.isArray(h))return i.apply(null,h);if(h.toString!==Object.prototype.toString&&!h.toString.toString().includes("[native code]"))return h.toString();var m="";for(var D in h)r.call(h,D)&&h[D]&&(m=c(m,D));return m}function c(h,m){return m?h?h+" "+m:h+m:h}n.exports?(i.default=i,n.exports=i):window.classNames=i})()})(e_);var DO=e_.exports;const ml=By(DO),SO=$e.forwardRef(({className:n,logoLink:r="https://www.oslo.kommune.no/",serviceName:i,fixed:l=!0,scrollToHide:c=!0,user:h,userMenu:m,representing:D,userOptions:C,userMenuFooter:T,canChangeRepresentation:$=!0,showMenuButton:N=!1,showLogOutButton:O=!1,openMenu:B,logOut:I,changeRepresentation:K,children:Y,...Ce},J)=>{const G=$e.useMemo(()=>typeof(h==null?void 0:h.lastLoggedIn)=="string"?h.lastLoggedIn:h!=null&&h.lastLoggedIn?new Date(h.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[h]),[re,V]=$e.useState(!1),[ae,ce]=$e.useState(0),[Te,ke]=$e.useState(!1),Ge=$e.useRef(null);$e.useEffect(()=>(document&&(document.addEventListener("mouseup",Ke),window.addEventListener("scroll",nt)),()=>{document&&(document.removeEventListener("mouseup",Ke),window.removeEventListener("scroll",nt))}));const We=()=>{ke(!Te)},Ke=He=>{Ge.current&&!Ge.current.contains(He.target)&&ke(!1)},nt=()=>{if(c){const He=window.pageYOffset||document.documentElement.scrollTop;if(He<0||Math.abs(He-ae)<60)return;V(He>ae),ce(He)}};return L.jsxs("header",{...Ce,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:ml(n,"pkt-header",{"pkt-header--fixed":l,"pkt-header--scroll-to-hide":c,"pkt-header--hidden":re}),ref:J,children:[L.jsxs("div",{className:"pkt-header__logo",children:[typeof r=="string"?L.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:r,children:L.jsx(br,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.40/logos/"})}):L.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:r,children:L.jsx(br,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.40/logos/"})}),L.jsx("span",{className:"pkt-header__logo-service",translate:"no",children:i})]}),L.jsx("nav",{className:"pkt-header__actions",children:L.jsxs("ul",{className:"pkt-header__actions-row",children:[N&&L.jsx("li",{children:L.jsx(Fd,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:B,children:"Meny"})}),(h||D)&&L.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${Te&&!re?"pkt-header--open-dropdown":""}`,ref:Ge,children:[L.jsxs("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":Te,onClick:We,children:[L.jsx(br,{name:"user",className:"pkt-btn__icon"}),L.jsx("span",{className:"pkt-header__user-fullname",translate:"no",children:(D==null?void 0:D.name)||(h==null?void 0:h.name)}),L.jsx("span",{className:"pkt-header__user-shortname",translate:"no",children:(D==null?void 0:D.shortname)||(h==null?void 0:h.shortname)}),L.jsx(br,{name:"chevron-thin-down",className:"pkt-btn--closed"}),L.jsx(br,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),L.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[h&&L.jsxs("li",{children:[L.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),L.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:h.name}),h.lastLoggedIn&&L.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",L.jsx("time",{children:G})]})]}),m&&L.jsx("li",{children:L.jsx("ul",{className:"pkt-list",children:m.map((He,dt)=>L.jsx("li",{children:typeof He.target=="string"?L.jsxs("a",{href:He.target,className:"pkt-link",children:[He.iconName&&L.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]}):L.jsxs("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:[He.iconName&&L.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]})},`userMenu-${dt}`))})}),(D||$)&&L.jsxs("li",{children:[D&&L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),L.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:D.name}),D.orgNumber&&L.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",D.orgNumber]})]}),L.jsx("ul",{className:"pkt-list mt-size-16",children:$&&L.jsx("li",{children:L.jsxs("button",{className:"pkt-link-button pkt-link",onClick:K,children:[L.jsx(br,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),L.jsx("li",{children:L.jsx("ul",{className:"pkt-list",children:(C||!O)&&L.jsxs(L.Fragment,{children:[C==null?void 0:C.map((He,dt)=>L.jsx("li",{children:typeof He.target=="string"?L.jsxs("a",{href:He.target,className:"pkt-link",children:[He.iconName&&L.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]}):L.jsxs("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:[He.iconName&&L.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]})},`userOptions-${dt}`)),!O&&L.jsx("li",{children:L.jsxs("button",{className:"pkt-link-button pkt-link",onClick:I,children:[L.jsx(br,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),T&&L.jsx("li",{className:"footer",children:L.jsx("ul",{className:"pkt-list-horizontal bordered",children:T.map((He,dt)=>L.jsx("li",{children:typeof He.target=="string"?L.jsx("a",{href:He.target,className:"pkt-link",children:He.title}):L.jsx("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:He.title})},`userMenuFooter-${dt}`))})})]})]}),Y&&L.jsx("li",{children:Y}),O&&L.jsx("li",{children:L.jsx(Fd,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:I,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),CO=Or({tagName:"pkt-helptext",elementClass:_d,react:$e,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),t_=$e.forwardRef(({children:n,...r},i)=>L.jsx(CO,{...r,ref:i,children:L.jsx("div",{className:"pkt-contents",children:n})}));t_.displayName="PktHelptext";const n_=$e.forwardRef(({label:n,id:r,children:i,...l},c)=>L.jsxs("div",{className:"pkt-form-group",children:[L.jsx("label",{htmlFor:r,className:"pkt-form-label",children:n}),L.jsx("input",{className:"pkt-form-input",id:r,...l,ref:c}),i]}));n_.displayName="PktInput";const _O=Or({tagName:"pkt-input-wrapper",elementClass:yr,react:$e,displayName:"PktInputWrapper",events:{onToggleHelpText:"toggleHelpText"}}),r_=$e.forwardRef(({children:n,helptext:r,...i},l)=>L.jsxs(_O,{ref:l,...i,children:[L.jsx("div",{className:"pkt-contents",slot:"helptext",children:r}),L.jsx("div",{className:"pkt-contents",children:n})]})),xO=Or({tagName:"pkt-link",elementClass:Ed,react:$e,displayName:"PktLink"}),a_=$e.forwardRef(({children:n,...r},i)=>L.jsx(xO,{...r,ref:i,children:L.jsx("span",{className:"pkt-contents",children:n})}));a_.displayName="PktLink";const EO=Or({tagName:"pkt-linkcard",elementClass:hc,react:$e,displayName:"PktLinkCard",events:{}}),i_=$e.forwardRef(({children:n,...r},i)=>L.jsx(EO,{ref:i,...r,children:L.jsx("div",{className:"pkt-contents",children:n})}));i_.displayName="PktLinkCard";const TO=Or({tagName:"pkt-loader",elementClass:pl,react:$e,displayName:"PktLoader",events:{}}),o_=$e.forwardRef(({children:n,...r},i)=>L.jsx(TO,{...r,ref:i,children:L.jsx("div",{className:"pkt-contents",children:n})}));o_.displayName="PktLoader";const AO=Or({tagName:"pkt-messagebox",elementClass:Td,react:$e,displayName:"PktMessagebox",events:{onClose:"close"}}),s_=$e.forwardRef(({children:n,...r},i)=>L.jsx(AO,{...r,ref:i,children:L.jsx("div",{className:"pkt-contents",children:n})}));s_.displayName="PktMessagebox";const FO=Or({tagName:"pkt-modal",elementClass:Qo,react:$e,displayName:"PktModal",events:{}}),l_=$e.forwardRef(({children:n,...r},i)=>L.jsx(FO,{...r,ref:i,children:L.jsx("div",{className:"pkt-contents",children:n})}));l_.displayName="PktModal";/*!
|
|
1423
1423
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
1424
1424
|
*
|
|
1425
1425
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.40.0",
|
|
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": "^12.
|
|
41
|
+
"@oslokommune/punkt-elements": "^12.40.0",
|
|
42
42
|
"angular-html-parser": "^6.0.2",
|
|
43
43
|
"html-format": "^1.1.7",
|
|
44
44
|
"prettier": "^3.3.3",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@babel/plugin-proposal-private-property-in-object": "^7.18.6",
|
|
51
51
|
"@oslokommune/punkt-assets": "^12.39.2",
|
|
52
|
-
"@oslokommune/punkt-css": "^12.
|
|
52
|
+
"@oslokommune/punkt-css": "^12.40.0",
|
|
53
53
|
"@testing-library/jest-dom": "^6.5.0",
|
|
54
54
|
"@testing-library/react": "^16.0.1",
|
|
55
55
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
113
113
|
},
|
|
114
114
|
"license": "MIT",
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "01a4a75820f2c854bd51a4fa590bedf37e2ce8ce"
|
|
116
116
|
}
|
|
@@ -14,9 +14,9 @@ type TCardTagPosition = 'top' | 'bottom'
|
|
|
14
14
|
|
|
15
15
|
export interface IPktCard extends PktElType {
|
|
16
16
|
ariaLabel?: string
|
|
17
|
-
|
|
17
|
+
metaLead?: string | null
|
|
18
18
|
borderOnHover?: boolean | null
|
|
19
|
-
|
|
19
|
+
metaTrail?: string | null
|
|
20
20
|
direction?: TDirection
|
|
21
21
|
heading?: string
|
|
22
22
|
headingLevel?: IPktHeading['level']
|