@oslokommune/punkt-elements 12.39.7 → 12.39.8

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,23 @@ 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
+ Ingen
18
+
19
+ ### Chores
20
+ Ingen
21
+
22
+ ---
23
+
24
+
8
25
  ## [12.39.7](https://github.com/oslokommune/punkt/compare/12.39.6...12.39.7) (2025-05-16)
9
26
 
10
27
  ### ⚠ BREAKING CHANGES
@@ -1,7 +1,7 @@
1
- import { e as c } from "./class-map-KyMqi0fa.js";
2
- import { o as g } from "./if-defined-BErSJCeJ.js";
3
- import { P as u, E as d, x as t, n as r, a as $ } from "./element-DjjF_tEh.js";
4
- import { P as m } from "./pkt-slot-controller-DtDaD9q_.js";
1
+ import { e as g } from "./class-map-KyMqi0fa.js";
2
+ import { o as c } from "./if-defined-BErSJCeJ.js";
3
+ import { P as m, E as d, x as t, n as i, a as $ } from "./element-DjjF_tEh.js";
4
+ import { P as u } from "./pkt-slot-controller-DtDaD9q_.js";
5
5
  import { e as _, n as y } from "./ref-iIffqQAI.js";
6
6
  import "./icon-Beoxup8E.js";
7
7
  import "./tag-Cu8afZy8.js";
@@ -18,18 +18,18 @@ const b = {
18
18
  }, k = {
19
19
  props: b
20
20
  };
21
- var f = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (a, s, p, o) => {
22
- for (var n = o > 1 ? void 0 : o ? S(s, p) : s, h = a.length - 1, l; h >= 0; h--)
23
- (l = a[h]) && (n = (o ? l(s, p, n) : l(n)) || n);
21
+ var f = Object.defineProperty, S = Object.getOwnPropertyDescriptor, a = (r, s, p, o) => {
22
+ for (var n = o > 1 ? void 0 : o ? S(s, p) : s, h = r.length - 1, l; h >= 0; h--)
23
+ (l = r[h]) && (n = (o ? l(s, p, n) : l(n)) || n);
24
24
  return o && n && f(s, p, n), n;
25
25
  };
26
- let e = class extends u {
26
+ let e = class extends m {
27
27
  //Constructor
28
28
  constructor() {
29
- super(), this.defaultSlot = _(), this.ariaLabel = "", this.author = null, this.borderOnHover = !0, this.clickCardLink = null, this.date = null, this.direction = k.props.direction.default, this.heading = "", this.headinglevel = 3, this.image = {
29
+ super(), this.defaultSlot = _(), this.ariaLabel = "", this.metaLead = null, this.borderOnHover = !0, this.clickCardLink = null, this.metaTrail = null, this.direction = k.props.direction.default, this.heading = "", this.headinglevel = 3, this.image = {
30
30
  src: "",
31
31
  alt: ""
32
- }, this.imageShape = "square", this.openLinkInNewTab = !1, this.padding = k.props.padding.default, this.skin = k.props.skin.default, this.subheading = "", this.tagPosition = "top", this.tags = [], this.slotController = new m(this, this.defaultSlot);
32
+ }, this.imageShape = "square", this.openLinkInNewTab = !1, this.padding = k.props.padding.default, this.skin = k.props.skin.default, this.subheading = "", this.tagPosition = "top", this.tags = [], this.slotController = new u(this, this.defaultSlot);
33
33
  }
34
34
  connectedCallback() {
35
35
  super.connectedCallback();
@@ -39,7 +39,7 @@ let e = class extends u {
39
39
  // prettier-ignore
40
40
  render() {
41
41
  var o, n;
42
- const a = {
42
+ const r = {
43
43
  "pkt-card": !0,
44
44
  [`pkt-card--${this.skin}`]: this.skin,
45
45
  [`pkt-card--${this.direction}`]: this.direction,
@@ -48,8 +48,8 @@ let e = class extends u {
48
48
  }, s = ((o = this.ariaLabel) == null ? void 0 : o.trim()) || (this.heading ? `${this.heading} lenkekort` : "lenkekort"), p = ((n = this.ariaLabel) == null ? void 0 : n.trim()) || (this.heading ? this.heading : "kort");
49
49
  return t`
50
50
  <article
51
- class=${c(a)}
52
- aria-label=${g(this.clickCardLink ? s : p)}
51
+ class=${g(r)}
52
+ aria-label=${c(this.clickCardLink ? s : p)}
53
53
  >
54
54
  ${this.renderImage()}
55
55
  <div class="pkt-card__wrapper">
@@ -57,20 +57,20 @@ let e = class extends u {
57
57
  ${this.renderHeader()}
58
58
  ${this.renderSlot()}
59
59
  ${this.tagPosition === "bottom" ? this.renderTags() : d}
60
- ${this.renderCreditline()}
60
+ ${this.renderMetadata()}
61
61
  </div>
62
62
  </article>
63
63
  `;
64
64
  }
65
65
  // Render methods for different parts of the card
66
66
  renderImage() {
67
- const a = {
67
+ const r = {
68
68
  "pkt-card__image": !0,
69
69
  [`pkt-card__image-${this.imageShape}`]: this.imageShape
70
70
  };
71
71
  return t`
72
72
  ${this.image.src && t`
73
- <div class=${c(a)}>
73
+ <div class=${g(r)}>
74
74
  <img src=${this.image.src} alt=${this.image.alt || ""} />
75
75
  </div>
76
76
  `}
@@ -119,9 +119,9 @@ let e = class extends u {
119
119
  // Render header
120
120
  // prettier-ignore
121
121
  renderHeader() {
122
- const a = !!this.heading || !!this.subheading;
122
+ const r = !!this.heading || !!this.subheading;
123
123
  return t`
124
- ${a ? t`
124
+ ${r ? t`
125
125
  <header class="pkt-card__header">
126
126
  ${this.renderHeading()}
127
127
  ${this.renderLinkHeading()}
@@ -131,14 +131,14 @@ let e = class extends u {
131
131
  `;
132
132
  }
133
133
  renderTags() {
134
- const a = {
134
+ const r = {
135
135
  "pkt-card__tags": !0,
136
136
  [`pkt-card__tags-${this.tagPosition}`]: this.tagPosition
137
137
  };
138
138
  return t`
139
139
  ${this.tags.length > 0 ? t`
140
140
  <div
141
- class=${c(a)}
141
+ class=${g(r)}
142
142
  role="list"
143
143
  aria-label=${this.tags.length > 1 ? "merkelapper" : "merkelapp"}
144
144
  >
@@ -148,8 +148,8 @@ let e = class extends u {
148
148
  role="listitem"
149
149
  textStyle="normal-text"
150
150
  size="medium"
151
- skin=${g(s.skin)}
152
- iconName=${g(s.iconName)}
151
+ skin=${c(s.skin)}
152
+ iconName=${c(s.iconName)}
153
153
  >
154
154
  ${s.text}
155
155
  </pkt-tag>
@@ -164,66 +164,66 @@ let e = class extends u {
164
164
  ${this.defaultSlot && t`<section class="pkt-card__content" ${y(this.defaultSlot)}></section>`}
165
165
  `;
166
166
  }
167
- renderCreditline() {
167
+ renderMetadata() {
168
168
  return t`
169
- ${this.author || this.date ? t`
170
- <footer class="pkt-card__creditline">
171
- ${this.author ? t`<span class="pkt-card__creditline-author">${this.author}</span>` : d}
172
- ${this.date ? t`<span class="pkt-card__creditline-date">${this.date}</span>` : d}
169
+ ${this.metaLead || this.metaTrail ? t`
170
+ <footer class="pkt-card__metadata">
171
+ ${this.metaLead ? t`<span class="pkt-card__metadata-lead">${this.metaLead}</span>` : d}
172
+ ${this.metaTrail ? t`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>` : d}
173
173
  </footer>
174
174
  ` : d}
175
175
  `;
176
176
  }
177
177
  };
178
- i([
179
- r({ type: String })
178
+ a([
179
+ i({ type: String })
180
180
  ], e.prototype, "ariaLabel", 2);
181
- i([
182
- r({ type: String })
183
- ], e.prototype, "author", 2);
184
- i([
185
- r({ type: Boolean })
181
+ a([
182
+ i({ type: String })
183
+ ], e.prototype, "metaLead", 2);
184
+ a([
185
+ i({ type: Boolean })
186
186
  ], e.prototype, "borderOnHover", 2);
187
- i([
188
- r({ type: String, reflect: !0 })
187
+ a([
188
+ i({ type: String, reflect: !0 })
189
189
  ], e.prototype, "clickCardLink", 2);
190
- i([
191
- r({ type: String })
192
- ], e.prototype, "date", 2);
193
- i([
194
- r({ type: String })
190
+ a([
191
+ i({ type: String })
192
+ ], e.prototype, "metaTrail", 2);
193
+ a([
194
+ i({ type: String })
195
195
  ], e.prototype, "direction", 2);
196
- i([
197
- r({ type: String })
196
+ a([
197
+ i({ type: String })
198
198
  ], e.prototype, "heading", 2);
199
- i([
200
- r({ type: Number })
199
+ a([
200
+ i({ type: Number })
201
201
  ], e.prototype, "headinglevel", 2);
202
- i([
203
- r({ type: Object })
202
+ a([
203
+ i({ type: Object })
204
204
  ], e.prototype, "image", 2);
205
- i([
206
- r({ type: String })
205
+ a([
206
+ i({ type: String })
207
207
  ], e.prototype, "imageShape", 2);
208
- i([
209
- r({ type: Boolean })
208
+ a([
209
+ i({ type: Boolean })
210
210
  ], e.prototype, "openLinkInNewTab", 2);
211
- i([
212
- r({ type: String })
211
+ a([
212
+ i({ type: String })
213
213
  ], e.prototype, "padding", 2);
214
- i([
215
- r({ type: String })
214
+ a([
215
+ i({ type: String })
216
216
  ], e.prototype, "skin", 2);
217
- i([
218
- r({ type: String })
217
+ a([
218
+ i({ type: String })
219
219
  ], e.prototype, "subheading", 2);
220
- i([
221
- r({ type: String })
220
+ a([
221
+ i({ type: String })
222
222
  ], e.prototype, "tagPosition", 2);
223
- i([
224
- r({ type: Array })
223
+ a([
224
+ i({ type: Array })
225
225
  ], e.prototype, "tags", 2);
226
- e = i([
226
+ e = a([
227
227
  $("pkt-card")
228
228
  ], e);
229
229
  export {
@@ -0,0 +1,87 @@
1
+ "use strict";const p=require("./class-map-DCyaICmy.cjs"),l=require("./if-defined-a3sotaUr.cjs"),t=require("./element-BSypUpzA.cjs"),g=require("./pkt-slot-controller-Da-RgXfS.cjs"),c=require("./ref-BvbyvXRH.cjs");require("./icon-BnKGwYjj.cjs");require("./tag-B9kFYxHg.cjs");const k={skin:{default:"outlined"},direction:{default:"portrait"},padding:{default:"standard"}},h={props:k};var u=Object.defineProperty,m=Object.getOwnPropertyDescriptor,e=(d,a,r,s)=>{for(var i=s>1?void 0:s?m(a,r):a,n=d.length-1,o;n>=0;n--)(o=d[n])&&(i=(s?o(a,r,i):o(i))||i);return s&&i&&u(a,r,i),i};exports.PktCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.direction=h.props.direction.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=h.props.padding.default,this.skin=h.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new g.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var i,n;const a={"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},r=((i=this.ariaLabel)==null?void 0:i.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),s=((n=this.ariaLabel)==null?void 0:n.trim())||(this.heading?this.heading:"kort");return t.x`
2
+ <article
3
+ class=${p.e(a)}
4
+ aria-label=${l.o(this.clickCardLink?r:s)}
5
+ >
6
+ ${this.renderImage()}
7
+ <div class="pkt-card__wrapper">
8
+ ${this.tagPosition==="top"?this.renderTags():t.E}
9
+ ${this.renderHeader()}
10
+ ${this.renderSlot()}
11
+ ${this.tagPosition==="bottom"?this.renderTags():t.E}
12
+ ${this.renderMetadata()}
13
+ </div>
14
+ </article>
15
+ `}renderImage(){const a={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return t.x`
16
+ ${this.image.src&&t.x`
17
+ <div class=${p.e(a)}>
18
+ <img src=${this.image.src} alt=${this.image.alt||""} />
19
+ </div>
20
+ `}
21
+ `}renderHeading(){return t.x`
22
+ ${this.heading&&!this.clickCardLink?t.x`
23
+ <pkt-heading
24
+ class="pkt-card__heading"
25
+ .level=${this.headinglevel||3}
26
+ size="medium"
27
+ nospacing
28
+ >
29
+ ${this.heading}
30
+ </pkt-heading>
31
+ `:t.E}
32
+ `}renderLinkHeading(){return t.x`
33
+ ${this.clickCardLink?t.x`
34
+ <pkt-heading
35
+ class="pkt-card__link-heading pkt-card__heading"
36
+ .level=${this.headinglevel||3}
37
+ size="medium"
38
+ nospacing
39
+ >
40
+ <a
41
+ class="pkt-card__link"
42
+ href=${this.clickCardLink}
43
+ target=${this.openLinkInNewTab?"_blank":"_self"}
44
+ >${this.heading}</a
45
+ >
46
+ </pkt-heading>
47
+ `:t.E}
48
+ `}renderSubheading(){return t.x`
49
+ ${this.subheading?t.x` <p class="pkt-card__subheading ">${this.subheading}</p> `:t.E}
50
+ `}renderHeader(){const a=!!this.heading||!!this.subheading;return t.x`
51
+ ${a?t.x`
52
+ <header class="pkt-card__header">
53
+ ${this.renderHeading()}
54
+ ${this.renderLinkHeading()}
55
+ ${this.renderSubheading()}
56
+ </header>
57
+ `:t.E}
58
+ `}renderTags(){const a={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return t.x`
59
+ ${this.tags.length>0?t.x`
60
+ <div
61
+ class=${p.e(a)}
62
+ role="list"
63
+ aria-label=${this.tags.length>1?"merkelapper":"merkelapp"}
64
+ >
65
+ ${this.tags.map(r=>t.x`
66
+ <pkt-tag
67
+ role="listitem"
68
+ textStyle="normal-text"
69
+ size="medium"
70
+ skin=${l.o(r.skin)}
71
+ iconName=${l.o(r.iconName)}
72
+ >
73
+ ${r.text}
74
+ </pkt-tag>
75
+ `)}
76
+ </div>
77
+ `:t.E}
78
+ `}renderSlot(){return t.x`
79
+ ${this.defaultSlot&&t.x`<section class="pkt-card__content" ${c.n(this.defaultSlot)}></section>`}
80
+ `}renderMetadata(){return t.x`
81
+ ${this.metaLead||this.metaTrail?t.x`
82
+ <footer class="pkt-card__metadata">
83
+ ${this.metaLead?t.x`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:t.E}
84
+ ${this.metaTrail?t.x`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:t.E}
85
+ </footer>
86
+ `:t.E}
87
+ `}};e([t.n({type:String})],exports.PktCard.prototype,"ariaLabel",2);e([t.n({type:String})],exports.PktCard.prototype,"metaLead",2);e([t.n({type:Boolean})],exports.PktCard.prototype,"borderOnHover",2);e([t.n({type:String,reflect:!0})],exports.PktCard.prototype,"clickCardLink",2);e([t.n({type:String})],exports.PktCard.prototype,"metaTrail",2);e([t.n({type:String})],exports.PktCard.prototype,"direction",2);e([t.n({type:String})],exports.PktCard.prototype,"heading",2);e([t.n({type:Number})],exports.PktCard.prototype,"headinglevel",2);e([t.n({type:Object})],exports.PktCard.prototype,"image",2);e([t.n({type:String})],exports.PktCard.prototype,"imageShape",2);e([t.n({type:Boolean})],exports.PktCard.prototype,"openLinkInNewTab",2);e([t.n({type:String})],exports.PktCard.prototype,"padding",2);e([t.n({type:String})],exports.PktCard.prototype,"skin",2);e([t.n({type:String})],exports.PktCard.prototype,"subheading",2);e([t.n({type:String})],exports.PktCard.prototype,"tagPosition",2);e([t.n({type:Array})],exports.PktCard.prototype,"tags",2);exports.PktCard=e([t.t("pkt-card")],exports.PktCard);
package/dist/index.d.ts CHANGED
@@ -120,8 +120,8 @@ export declare interface IPktButton {
120
120
 
121
121
  declare interface IPktCard {
122
122
  ariaLabel?: IAriaAttributes['aria-label'];
123
- author?: string | null;
124
- date?: string | null;
123
+ metaLead?: string | null;
124
+ metaTrail?: string | null;
125
125
  direction?: TDirection;
126
126
  heading?: string;
127
127
  headingLevel?: IPktHeading['level'];
@@ -462,10 +462,10 @@ export declare class PktCard extends PktElement implements IPktCard {
462
462
  defaultSlot: Ref<HTMLElement>;
463
463
  constructor();
464
464
  ariaLabel: string;
465
- author: string | null;
465
+ metaLead: string | null;
466
466
  borderOnHover: boolean;
467
467
  clickCardLink: IPktCard['clickCardLink'];
468
- date: string | null;
468
+ metaTrail: string | null;
469
469
  direction: TDirection;
470
470
  heading: string;
471
471
  headinglevel: IPktHeading['level'];
@@ -491,7 +491,7 @@ export declare class PktCard extends PktElement implements IPktCard {
491
491
  renderHeader(): TemplateResult<1>;
492
492
  renderTags(): TemplateResult<1>;
493
493
  renderSlot(): TemplateResult<1>;
494
- renderCreditline(): TemplateResult<1>;
494
+ renderMetadata(): TemplateResult<1>;
495
495
  }
496
496
 
497
497
  export declare class PktCheckbox extends PktInputElement {
package/dist/pkt-card.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./card-Di1MQneh.cjs"),t=e.PktCard;Object.defineProperty(exports,"PktCard",{enumerable:!0,get:()=>e.PktCard});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./card-C8wbJJyj.cjs"),t=e.PktCard;Object.defineProperty(exports,"PktCard",{enumerable:!0,get:()=>e.PktCard});exports.default=t;
package/dist/pkt-card.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P as a } from "./card-CZG7XGlj.js";
1
+ import { P as a } from "./card-Bx2WyoYH.js";
2
2
  const r = a;
3
3
  export {
4
4
  a as PktCard,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./alert-C2EPmB0W.cjs"),l=require("./accordionitem-RFwXQC_0.cjs"),d=require("./backlink-HHM21crL.cjs"),b=require("./button-C60j8BsA.cjs"),k=require("./calendar-CYY42kN4.cjs"),m=require("./card-Di1MQneh.cjs"),g=require("./combobox-dwkB9Yv_.cjs"),h=require("./consent-1ZSUrWK9.cjs"),f=require("./checkbox-7ct89AUo.cjs"),t=require("./element-BSypUpzA.cjs"),y=require("./pkt-slot-controller-Da-RgXfS.cjs"),s=require("./ref-BvbyvXRH.cjs"),O=require("./class-map-DCyaICmy.cjs"),j=require("./datepicker-BDnncwne.cjs"),q=require("./helptext-bMgnhZ1R.cjs"),x=require("./heading-BnJhJDMD.cjs"),C=require("./icon-BnKGwYjj.cjs"),v=require("./input-wrapper-B-f_SotM.cjs"),S=require("./link-nesPZCIx.cjs"),$=require("./linkcard-s9yoOq90.cjs"),L=require("./loader-ndMy12Pb.cjs"),_=require("./messagebox-B0kgftoP.cjs"),A=require("./modal-C8GbUY8p.cjs"),B=require("./progressbar-DiRfScnB.cjs"),p=require("./radiobutton-DGWTMdAZ.cjs"),T=require("./tag-B9kFYxHg.cjs"),I=require("./textarea-yUzqcBYY.cjs"),M=require("./textinput-8mT0npMY.cjs"),R=require("./select-Brv7vglu.cjs");var H=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(a,e,r,i)=>{for(var n=i>1?void 0:i?w(e,r):e,u=a.length-1,c;u>=0;u--)(c=a[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&H(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=s.e(),this.namedSlot=s.e(),this.slotController=new y.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./alert-C2EPmB0W.cjs"),l=require("./accordionitem-RFwXQC_0.cjs"),d=require("./backlink-HHM21crL.cjs"),b=require("./button-C60j8BsA.cjs"),k=require("./calendar-CYY42kN4.cjs"),m=require("./card-C8wbJJyj.cjs"),g=require("./combobox-dwkB9Yv_.cjs"),h=require("./consent-1ZSUrWK9.cjs"),f=require("./checkbox-7ct89AUo.cjs"),t=require("./element-BSypUpzA.cjs"),y=require("./pkt-slot-controller-Da-RgXfS.cjs"),s=require("./ref-BvbyvXRH.cjs"),O=require("./class-map-DCyaICmy.cjs"),j=require("./datepicker-BDnncwne.cjs"),q=require("./helptext-bMgnhZ1R.cjs"),x=require("./heading-BnJhJDMD.cjs"),C=require("./icon-BnKGwYjj.cjs"),v=require("./input-wrapper-B-f_SotM.cjs"),S=require("./link-nesPZCIx.cjs"),$=require("./linkcard-s9yoOq90.cjs"),L=require("./loader-ndMy12Pb.cjs"),_=require("./messagebox-B0kgftoP.cjs"),A=require("./modal-C8GbUY8p.cjs"),B=require("./progressbar-DiRfScnB.cjs"),p=require("./radiobutton-DGWTMdAZ.cjs"),T=require("./tag-B9kFYxHg.cjs"),I=require("./textarea-yUzqcBYY.cjs"),M=require("./textinput-8mT0npMY.cjs"),R=require("./select-Brv7vglu.cjs");var H=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(a,e,r,i)=>{for(var n=i>1?void 0:i?w(e,r):e,u=a.length-1,c;u>=0;u--)(c=a[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&H(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=s.e(),this.namedSlot=s.e(),this.slotController=new y.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
2
2
  <div class="${O.e(e)}">
3
3
  <h1 class="pkt-txt-28">${this.string}</h1>
4
4
 
package/dist/pkt-index.js CHANGED
@@ -4,7 +4,7 @@ import { P as O } from "./backlink-hvyJmwrO.js";
4
4
  import { P as T } from "./button-BCCtR9ff.js";
5
5
  import { c as f } from "./calendar-KDcOWD6V.js";
6
6
  import { P as D } from "./calendar-KDcOWD6V.js";
7
- import { P as G } from "./card-CZG7XGlj.js";
7
+ import { P as G } from "./card-Bx2WyoYH.js";
8
8
  import { P as K } from "./combobox-DewmPXyJ.js";
9
9
  import { P as U } from "./consent-c6eWVBWx.js";
10
10
  import { P as q } from "./checkbox-D5fSFvhs.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-elements",
3
- "version": "12.39.7",
3
+ "version": "12.39.8",
4
4
  "description": "Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@oslokommune/punkt-assets": "^12.39.2",
35
- "@oslokommune/punkt-css": "^12.39.7",
35
+ "@oslokommune/punkt-css": "^12.39.8",
36
36
  "sass": "^1.78.0",
37
37
  "typescript": "^5.6.2",
38
38
  "vite": "^5.4.18",
@@ -59,5 +59,5 @@
59
59
  "url": "https://github.com/oslokommune/punkt/issues"
60
60
  },
61
61
  "license": "MIT",
62
- "gitHead": "504099164121e630280de133dfc4accf97765a8f"
62
+ "gitHead": "9837c1edd0b49ecdc14a46ede9442d30bdb9d908"
63
63
  }
@@ -20,8 +20,8 @@ export type TCardTagPosition = 'top' | 'bottom'
20
20
 
21
21
  export interface IPktCard {
22
22
  ariaLabel?: IAriaAttributes['aria-label']
23
- author?: string | null
24
- date?: string | null
23
+ metaLead?: string | null
24
+ metaTrail?: string | null
25
25
  direction?: TDirection
26
26
  heading?: string
27
27
  headingLevel?: IPktHeading['level']
@@ -53,10 +53,10 @@ export class PktCard extends PktElement implements IPktCard {
53
53
  // Properties
54
54
 
55
55
  @property({ type: String }) ariaLabel: string = ''
56
- @property({ type: String }) author: string | null = null
56
+ @property({ type: String }) metaLead: string | null = null
57
57
  @property({ type: Boolean }) borderOnHover: boolean = true
58
58
  @property({ type: String, reflect: true }) clickCardLink: IPktCard['clickCardLink'] = null
59
- @property({ type: String }) date: string | null = null
59
+ @property({ type: String }) metaTrail: string | null = null
60
60
  @property({ type: String }) direction: TDirection = specs.props.direction.default as TDirection
61
61
  @property({ type: String }) heading: string = ''
62
62
  @property({ type: Number }) headinglevel: IPktHeading['level'] = 3
@@ -106,7 +106,7 @@ export class PktCard extends PktElement implements IPktCard {
106
106
  ${this.renderHeader()}
107
107
  ${this.renderSlot()}
108
108
  ${this.tagPosition === 'bottom' ? this.renderTags() : nothing}
109
- ${this.renderCreditline()}
109
+ ${this.renderMetadata()}
110
110
  </div>
111
111
  </article>
112
112
  `
@@ -233,16 +233,16 @@ export class PktCard extends PktElement implements IPktCard {
233
233
  `
234
234
  }
235
235
 
236
- renderCreditline() {
236
+ renderMetadata() {
237
237
  return html`
238
- ${this.author || this.date
238
+ ${this.metaLead || this.metaTrail
239
239
  ? html`
240
- <footer class="pkt-card__creditline">
241
- ${this.author
242
- ? html`<span class="pkt-card__creditline-author">${this.author}</span>`
240
+ <footer class="pkt-card__metadata">
241
+ ${this.metaLead
242
+ ? html`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`
243
243
  : nothing}
244
- ${this.date
245
- ? html`<span class="pkt-card__creditline-date">${this.date}</span>`
244
+ ${this.metaTrail
245
+ ? html`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`
246
246
  : nothing}
247
247
  </footer>
248
248
  `
@@ -1,87 +0,0 @@
1
- "use strict";const p=require("./class-map-DCyaICmy.cjs"),h=require("./if-defined-a3sotaUr.cjs"),t=require("./element-BSypUpzA.cjs"),g=require("./pkt-slot-controller-Da-RgXfS.cjs"),c=require("./ref-BvbyvXRH.cjs");require("./icon-BnKGwYjj.cjs");require("./tag-B9kFYxHg.cjs");const k={skin:{default:"outlined"},direction:{default:"portrait"},padding:{default:"standard"}},l={props:k};var u=Object.defineProperty,$=Object.getOwnPropertyDescriptor,e=(d,i,a,n)=>{for(var r=n>1?void 0:n?$(i,a):i,s=d.length-1,o;s>=0;s--)(o=d[s])&&(r=(n?o(i,a,r):o(r))||r);return n&&r&&u(i,a,r),r};exports.PktCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.ariaLabel="",this.author=null,this.borderOnHover=!0,this.clickCardLink=null,this.date=null,this.direction=l.props.direction.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=l.props.padding.default,this.skin=l.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new g.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var r,s;const i={"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},a=((r=this.ariaLabel)==null?void 0:r.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),n=((s=this.ariaLabel)==null?void 0:s.trim())||(this.heading?this.heading:"kort");return t.x`
2
- <article
3
- class=${p.e(i)}
4
- aria-label=${h.o(this.clickCardLink?a:n)}
5
- >
6
- ${this.renderImage()}
7
- <div class="pkt-card__wrapper">
8
- ${this.tagPosition==="top"?this.renderTags():t.E}
9
- ${this.renderHeader()}
10
- ${this.renderSlot()}
11
- ${this.tagPosition==="bottom"?this.renderTags():t.E}
12
- ${this.renderCreditline()}
13
- </div>
14
- </article>
15
- `}renderImage(){const i={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return t.x`
16
- ${this.image.src&&t.x`
17
- <div class=${p.e(i)}>
18
- <img src=${this.image.src} alt=${this.image.alt||""} />
19
- </div>
20
- `}
21
- `}renderHeading(){return t.x`
22
- ${this.heading&&!this.clickCardLink?t.x`
23
- <pkt-heading
24
- class="pkt-card__heading"
25
- .level=${this.headinglevel||3}
26
- size="medium"
27
- nospacing
28
- >
29
- ${this.heading}
30
- </pkt-heading>
31
- `:t.E}
32
- `}renderLinkHeading(){return t.x`
33
- ${this.clickCardLink?t.x`
34
- <pkt-heading
35
- class="pkt-card__link-heading pkt-card__heading"
36
- .level=${this.headinglevel||3}
37
- size="medium"
38
- nospacing
39
- >
40
- <a
41
- class="pkt-card__link"
42
- href=${this.clickCardLink}
43
- target=${this.openLinkInNewTab?"_blank":"_self"}
44
- >${this.heading}</a
45
- >
46
- </pkt-heading>
47
- `:t.E}
48
- `}renderSubheading(){return t.x`
49
- ${this.subheading?t.x` <p class="pkt-card__subheading ">${this.subheading}</p> `:t.E}
50
- `}renderHeader(){const i=!!this.heading||!!this.subheading;return t.x`
51
- ${i?t.x`
52
- <header class="pkt-card__header">
53
- ${this.renderHeading()}
54
- ${this.renderLinkHeading()}
55
- ${this.renderSubheading()}
56
- </header>
57
- `:t.E}
58
- `}renderTags(){const i={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return t.x`
59
- ${this.tags.length>0?t.x`
60
- <div
61
- class=${p.e(i)}
62
- role="list"
63
- aria-label=${this.tags.length>1?"merkelapper":"merkelapp"}
64
- >
65
- ${this.tags.map(a=>t.x`
66
- <pkt-tag
67
- role="listitem"
68
- textStyle="normal-text"
69
- size="medium"
70
- skin=${h.o(a.skin)}
71
- iconName=${h.o(a.iconName)}
72
- >
73
- ${a.text}
74
- </pkt-tag>
75
- `)}
76
- </div>
77
- `:t.E}
78
- `}renderSlot(){return t.x`
79
- ${this.defaultSlot&&t.x`<section class="pkt-card__content" ${c.n(this.defaultSlot)}></section>`}
80
- `}renderCreditline(){return t.x`
81
- ${this.author||this.date?t.x`
82
- <footer class="pkt-card__creditline">
83
- ${this.author?t.x`<span class="pkt-card__creditline-author">${this.author}</span>`:t.E}
84
- ${this.date?t.x`<span class="pkt-card__creditline-date">${this.date}</span>`:t.E}
85
- </footer>
86
- `:t.E}
87
- `}};e([t.n({type:String})],exports.PktCard.prototype,"ariaLabel",2);e([t.n({type:String})],exports.PktCard.prototype,"author",2);e([t.n({type:Boolean})],exports.PktCard.prototype,"borderOnHover",2);e([t.n({type:String,reflect:!0})],exports.PktCard.prototype,"clickCardLink",2);e([t.n({type:String})],exports.PktCard.prototype,"date",2);e([t.n({type:String})],exports.PktCard.prototype,"direction",2);e([t.n({type:String})],exports.PktCard.prototype,"heading",2);e([t.n({type:Number})],exports.PktCard.prototype,"headinglevel",2);e([t.n({type:Object})],exports.PktCard.prototype,"image",2);e([t.n({type:String})],exports.PktCard.prototype,"imageShape",2);e([t.n({type:Boolean})],exports.PktCard.prototype,"openLinkInNewTab",2);e([t.n({type:String})],exports.PktCard.prototype,"padding",2);e([t.n({type:String})],exports.PktCard.prototype,"skin",2);e([t.n({type:String})],exports.PktCard.prototype,"subheading",2);e([t.n({type:String})],exports.PktCard.prototype,"tagPosition",2);e([t.n({type:Array})],exports.PktCard.prototype,"tags",2);exports.PktCard=e([t.t("pkt-card")],exports.PktCard);