@oslokommune/punkt-elements 18.3.1 → 18.5.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 +42 -0
- package/dist/{accordion-4eAsO-Sr.js → accordion-D814csFx.js} +6 -6
- package/dist/{accordion-DOa5vubf.cjs → accordion-E0-pLzBq.cjs} +6 -6
- package/dist/{alert-DKNJTlMQ.js → alert-DNZtr3gd.js} +39 -31
- package/dist/alert-DqM9l5as.cjs +40 -0
- package/dist/{backlink-CA5R69FX.cjs → backlink-DYO8qA9C.cjs} +1 -1
- package/dist/{button-Dqolsuwj.js → button-Drwt7Qe5.js} +29 -26
- package/dist/button-jJfzE9C7.cjs +32 -0
- package/dist/{card-DgRvtnnk.js → card-BhmJZOGh.js} +90 -70
- package/dist/card-D-1JMn_h.cjs +64 -0
- package/dist/{combobox-q8kzy-S_.js → combobox-BNstYIC5.js} +20 -20
- package/dist/{combobox-D3zyAi_o.cjs → combobox-CRdBlMz1.cjs} +17 -17
- package/dist/components/alert/alert.d.ts +2 -0
- package/dist/components/button/button.d.ts +4 -21
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/card/card.d.ts +12 -3
- package/dist/components/index.d.ts +1 -1
- package/dist/components/linkcard/linkcard.d.ts +1 -1
- package/dist/components/loader/loader.d.ts +2 -2
- package/dist/components/messagebox/messagebox.d.ts +1 -1
- package/dist/components/progressbar/progressbar.d.ts +2 -6
- package/dist/{consent-Cqetmc5Q.cjs → consent-DaOFbopy.cjs} +1 -1
- package/dist/{consent-Dkyp-UbI.js → consent-Yvw7gZI_.js} +1 -1
- package/dist/{datepicker-8KnaI9Xj.cjs → datepicker-DjvL_Nb8.cjs} +16 -16
- package/dist/{datepicker-9ulmApjN.js → datepicker-DzTdWHkX.js} +3 -3
- package/dist/docs/components/button.d.ts +0 -1
- package/dist/{fileupload-XQAilDRd.js → fileupload-B8Uhfx2d.js} +24 -24
- package/dist/{fileupload-EWBE4h3V.cjs → fileupload-BJVYPl8u.cjs} +15 -15
- package/dist/{footer-BpuYmm5V.cjs → footer-BGC5PkLa.cjs} +1 -1
- package/dist/{footer-BXmN43ol.js → footer-BPxKLaut.js} +2 -2
- package/dist/{header-BPQHiw4v.js → header-BPzlBRhY.js} +30 -30
- package/dist/{header-BQ32MqUl.cjs → header-CAqegPzW.cjs} +34 -34
- package/dist/{header-menu-DpQbRKcm.cjs → header-menu-DBy7Yrd_.cjs} +1 -1
- package/dist/{header-menu-Dgem4HO9.js → header-menu-DWiPoQ58.js} +1 -1
- package/dist/{helptext-Ds8Q9IGV.cjs → helptext-BwDhf6VB.cjs} +2 -2
- package/dist/{helptext-BzLJKMMO.js → helptext-mf-67-fv.js} +2 -2
- package/dist/{input-wrapper-DzEgz7nZ.js → input-wrapper-BetB7OLQ.js} +16 -15
- package/dist/{input-wrapper-B0eSdZs3.cjs → input-wrapper-CS0qrYcm.cjs} +8 -7
- package/dist/{link-CpwR3BLX.cjs → link-DXnoMJIo.cjs} +3 -3
- package/dist/{link-C9xAIILf.js → link-DkO7a3Fs.js} +3 -3
- package/dist/{linkcard-Bzv3CEw5.cjs → linkcard-2l6z1M2U.cjs} +3 -3
- package/dist/{linkcard-C6ljKc0B.js → linkcard-aVKL5JPP.js} +8 -8
- package/dist/{loader-D6dau_7w.js → loader-CRVUJ-HU.js} +1 -1
- package/dist/{loader-Bv-1vwju.cjs → loader-D23kzlaR.cjs} +1 -1
- package/dist/{messagebox-CmhjIh0n.js → messagebox-CqI6_Ah7.js} +2 -2
- package/dist/{messagebox-DNUfv2FN.cjs → messagebox-DP06cyqc.cjs} +1 -1
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -1
- package/dist/pkt-footer.cjs +1 -1
- package/dist/pkt-footer.js +1 -1
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -1
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +31 -31
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-searchinput.cjs +1 -1
- package/dist/pkt-searchinput.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -1
- package/dist/progressbar-BPHLC7ce.js +117 -0
- package/dist/progressbar-BpcsDCnG.cjs +31 -0
- package/dist/{radiobutton-B_j_nYCC.js → radiobutton-B2e9Vyp8.js} +0 -1
- package/dist/{radiobutton-DsL-FNDd.cjs → radiobutton-C3nmL9rA.cjs} +0 -1
- package/dist/{searchinput-Dm3T0tGS.cjs → searchinput-CiPB8xvh.cjs} +3 -2
- package/dist/{searchinput-D7Dd2W2z.js → searchinput-DrUcPajl.js} +14 -12
- package/dist/{select-BqAZsLKy.js → select-B7TvZGIL.js} +15 -16
- package/dist/{select-VqzZdE-T.cjs → select-qxjHJ8bu.cjs} +13 -14
- package/dist/shared-types/button.d.ts +45 -0
- package/dist/shared-types/index.d.ts +2 -0
- package/dist/{tabs-DPdDkHSk.js → tabs-C_tCCdBK.js} +18 -18
- package/dist/{tabs-nvIpMwHK.cjs → tabs-DBanbSG1.cjs} +15 -15
- package/dist/tag-BDlwKjgT.cjs +27 -0
- package/dist/{tag-DBCzfbPE.js → tag-CdiDs9zb.js} +10 -10
- package/dist/{textarea-D17CiySU.cjs → textarea-DgFwd2LY.cjs} +10 -10
- package/dist/{textarea-C0a-K05x.js → textarea-YL6JYsB5.js} +14 -14
- package/dist/{textinput-D0QasOZ9.cjs → textinput-CIxMtaIo.cjs} +10 -10
- package/dist/{textinput-DKl04Y3e.js → textinput-CrJYDOHb.js} +12 -12
- package/dist/{timepicker-DVvI4uEk.js → timepicker-BHWOqlr8.js} +11 -11
- package/dist/{timepicker-BcnFL6Bj.cjs → timepicker-avaMu1hN.cjs} +8 -8
- package/package.json +2 -2
- package/src/components/accordion/accordion.ts +2 -1
- package/src/components/alert/alert.test.ts +2 -1
- package/src/components/alert/alert.ts +21 -3
- package/src/components/button/button.test.ts +0 -3
- package/src/components/button/button.ts +57 -62
- package/src/components/button/index.ts +0 -2
- package/src/components/card/card.test.ts +7 -7
- package/src/components/card/card.ts +99 -80
- package/src/components/helptext/helptext.ts +2 -2
- package/src/components/index.ts +0 -2
- package/src/components/input-wrapper/input-wrapper.ts +1 -0
- package/src/components/link/link.ts +4 -2
- package/src/components/linkcard/linkcard.test.ts +3 -3
- package/src/components/linkcard/linkcard.ts +1 -1
- package/src/components/loader/loader.test.ts +1 -1
- package/src/components/loader/loader.ts +3 -3
- package/src/components/messagebox/messagebox.test.ts +1 -1
- package/src/components/messagebox/messagebox.ts +2 -2
- package/src/components/progressbar/progressbar.test.ts +10 -8
- package/src/components/progressbar/progressbar.ts +63 -84
- package/src/components/radiobutton/radiobutton.ts +0 -1
- package/src/components/searchinput/searchinput.ts +3 -1
- package/src/components/select/select.test.ts +2 -1
- package/src/components/select/select.ts +0 -1
- package/dist/alert-BlHM1zEi.cjs +0 -35
- package/dist/button-CVMhQT3X.cjs +0 -30
- package/dist/card-DMKvuvNv.cjs +0 -87
- package/dist/progressbar-Bk_RsEjW.js +0 -112
- package/dist/progressbar-T5_MpZGN.cjs +0 -17
- package/dist/tag-Bp9gJnYh.cjs +0 -27
- package/dist/{backlink-BYUtL8cO.js → backlink-BHtxOlTw.js} +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,48 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [18.5.0](https://github.com/oslokommune/punkt/compare/18.4.0...18.5.0) (2026-09-07)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
* Conformance-testing for HTML mellom rammeverkene (#3618). Et nytt testsett som kjører gjennom alle komponenter, rendrer de ut, og sjekker at HTML er likt mellom komponentene. Les README for ny pakke for detaljert info.
|
|
15
|
+
|
|
16
|
+
- Endringer i CSS og komponentene for å få HTML-output helt identisk
|
|
17
|
+
- Bruker i større grad Astro-komponenter for å lage testsider i CSS-pakken (enklere å vedlikeholde)
|
|
18
|
+
- Flere bugfikser som er avdekket gjennom konformitetstestingen
|
|
19
|
+
- La til noen nye udokumenterte metoder i card for å støtte potensiell ny bruker bedre
|
|
20
|
+
|
|
21
|
+
OBS! Endret default på `loader`-komponentene, fordi `shapes` var aldri ment å være default, og dokumentasjonen og specs sier at `rainbow` skal være default.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
Ingen
|
|
26
|
+
|
|
27
|
+
### Chores
|
|
28
|
+
Ingen
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [18.4.0](https://github.com/oslokommune/punkt/compare/18.3.2...18.4.0) (2026-09-03)
|
|
34
|
+
|
|
35
|
+
### ⚠ BREAKING CHANGES
|
|
36
|
+
Ingen
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
Ingen
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
Ingen
|
|
43
|
+
|
|
44
|
+
### Chores
|
|
45
|
+
Ingen
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
|
|
8
50
|
## [18.3.1](https://github.com/oslokommune/punkt/compare/18.3.0...18.3.1) (2026-09-02)
|
|
9
51
|
|
|
10
52
|
### ⚠ BREAKING CHANGES
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as e, c as t, d as n, l as r, n as i, u as a } from "./element-e2MAMNEP.js";
|
|
2
2
|
import { t as o } from "./class-map-BL_YL_Ed.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as l } from "./
|
|
3
|
+
import { t as s } from "./if-defined-r8tKY4tG.js";
|
|
4
|
+
import { n as c, t as l } from "./element-with-slot-COOwQUxM.js";
|
|
5
5
|
import { n as u, r as d, t as f } from "./consume-BDnMAp2g.js";
|
|
6
6
|
import { n as p, t as m } from "./ref-lE1mGUOL.js";
|
|
7
7
|
//#region src/components/accordion/accordion-context.ts
|
|
@@ -43,7 +43,7 @@ var h = d(Symbol("pkt-accordion-context")), g = class extends t {
|
|
|
43
43
|
part="container"
|
|
44
44
|
class=${o(t)}
|
|
45
45
|
data-testid="pkt-accordion"
|
|
46
|
-
aria-labelledby=${this.ariaLabelledBy}
|
|
46
|
+
aria-labelledby=${s(this.ariaLabelledBy || void 0)}
|
|
47
47
|
>
|
|
48
48
|
<slot></slot>
|
|
49
49
|
</div>
|
|
@@ -74,7 +74,7 @@ try {
|
|
|
74
74
|
}
|
|
75
75
|
//#endregion
|
|
76
76
|
//#region src/components/accordion/accordionitem.ts
|
|
77
|
-
var _ = class extends
|
|
77
|
+
var _ = class extends l {
|
|
78
78
|
constructor() {
|
|
79
79
|
super(), this.defaultOpen = !1, this.title = "", this.skin = void 0, this.compact = !1, this.isOpen = !1, this.name = void 0, this.accordionItemRef = m();
|
|
80
80
|
}
|
|
@@ -93,7 +93,7 @@ var _ = class extends c {
|
|
|
93
93
|
id=${this.id}
|
|
94
94
|
?open=${this.isOpen}
|
|
95
95
|
${p(this.accordionItemRef)}
|
|
96
|
-
name=${
|
|
96
|
+
name=${s(this.name)}
|
|
97
97
|
>
|
|
98
98
|
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
99
99
|
${this.title}
|
|
@@ -121,7 +121,7 @@ var _ = class extends c {
|
|
|
121
121
|
id="pkt-accordion-item__content-${this.id}"
|
|
122
122
|
role="region"
|
|
123
123
|
>
|
|
124
|
-
<div class="pkt-accordion-item__content-inner">${
|
|
124
|
+
<div class="pkt-accordion-item__content-inner">${c(this)}</div>
|
|
125
125
|
</div>
|
|
126
126
|
</details>
|
|
127
127
|
`;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),n=require("./
|
|
1
|
+
const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),n=require("./if-defined-BeVQnl3C.cjs"),r=require("./element-with-slot-MkibfzHp.cjs"),i=require("./consume-Le4HztPo.cjs"),a=require("./ref-BkV4Cd8U.cjs");var o=i.r(Symbol(`pkt-accordion-context`)),s=class extends e.c{constructor(...e){super(...e),this.ariaLabelledBy=``,this.compact=!1,this.skin=`borderless`,this.name=``,this.context={skin:this.skin}}willUpdate(e){e.has(`skin`)&&(this.context={...this.context,skin:this.skin})}updated(e){e.has(`name`)&&this.updateAccordionItemNames()}updateAccordionItemNames(){if(this.name){let e=this.renderRoot?.querySelector(`slot`);e&&e.assignedElements().forEach(e=>{e.tagName.toLowerCase()===`pkt-accordion-item`&&(e.hasAttribute(`name`)||e.setAttribute(`name`,this.name))})}}firstUpdated(){let e=this.renderRoot?.querySelector(`slot`);e&&e.addEventListener(`slotchange`,()=>{this.updateAccordionItemNames()})}render(){let r={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return e._`
|
|
2
2
|
<div
|
|
3
3
|
part="container"
|
|
4
|
-
class=${t.t(
|
|
4
|
+
class=${t.t(r)}
|
|
5
5
|
data-testid="pkt-accordion"
|
|
6
|
-
aria-labelledby=${this.ariaLabelledBy}
|
|
6
|
+
aria-labelledby=${n.t(this.ariaLabelledBy||void 0)}
|
|
7
7
|
>
|
|
8
8
|
<slot></slot>
|
|
9
9
|
</div>
|
|
10
|
-
`}};e.n([e.u({type:String,reflect:!0,attribute:`aria-labelledby`})],s.prototype,`ariaLabelledBy`,void 0),e.n([e.u({type:Boolean,reflect:!0,attribute:`compact`})],s.prototype,`compact`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`skin`})],s.prototype,`skin`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`name`})],s.prototype,`name`,void 0),e.n([i.n({context:o}),e.l()],s.prototype,`context`,void 0);try{e.d(`pkt-accordion`)(s)}catch{console.warn(`Forsøker å definere <pkt-accordion>, men den er allerede definert`)}var c=class extends
|
|
10
|
+
`}};e.n([e.u({type:String,reflect:!0,attribute:`aria-labelledby`})],s.prototype,`ariaLabelledBy`,void 0),e.n([e.u({type:Boolean,reflect:!0,attribute:`compact`})],s.prototype,`compact`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`skin`})],s.prototype,`skin`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`name`})],s.prototype,`name`,void 0),e.n([i.n({context:o}),e.l()],s.prototype,`context`,void 0);try{e.d(`pkt-accordion`)(s)}catch{console.warn(`Forsøker å definere <pkt-accordion>, men den er allerede definert`)}var c=class extends r.t{constructor(){super(),this.defaultOpen=!1,this.title=``,this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=a.t()}firstUpdated(e){this.defaultOpen&&(this.isOpen=!0)}render(){let i={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin},o=(this.skin??this.context?.skin)===`plus-minus`;return e._`
|
|
11
11
|
<details
|
|
12
12
|
class=${t.t(i)}
|
|
13
13
|
id=${this.id}
|
|
14
14
|
?open=${this.isOpen}
|
|
15
15
|
${a.n(this.accordionItemRef)}
|
|
16
|
-
name=${
|
|
16
|
+
name=${n.t(this.name)}
|
|
17
17
|
>
|
|
18
18
|
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
19
19
|
${this.title}
|
|
@@ -41,7 +41,7 @@ const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),
|
|
|
41
41
|
id="pkt-accordion-item__content-${this.id}"
|
|
42
42
|
role="region"
|
|
43
43
|
>
|
|
44
|
-
<div class="pkt-accordion-item__content-inner">${
|
|
44
|
+
<div class="pkt-accordion-item__content-inner">${r.n(this)}</div>
|
|
45
45
|
</div>
|
|
46
46
|
</details>
|
|
47
47
|
`}};e.n([e.u({type:Boolean})],c.prototype,`defaultOpen`,void 0),e.n([e.u({type:String})],c.prototype,`title`,void 0),e.n([e.u({type:String,reflect:!0})],c.prototype,`skin`,void 0),e.n([e.u({type:Boolean,reflect:!0})],c.prototype,`compact`,void 0),e.n([e.u({type:Boolean,reflect:!0})],c.prototype,`isOpen`,void 0),e.n([e.u({type:String,reflect:!0})],c.prototype,`name`,void 0),e.n([i.t({context:o,subscribe:!0}),e.u({attribute:!1})],c.prototype,`context`,void 0);try{e.d(`pkt-accordion-item`)(c)}catch{console.warn(`Forsøker å definere <pkt-accordion-item>, men den er allerede definert`)}var l=s;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-e2MAMNEP.js";
|
|
2
2
|
import { t as o } from "./class-map-BL_YL_Ed.js";
|
|
3
|
-
import { t as s } from "./
|
|
4
|
-
import {
|
|
5
|
-
import { t as u } from "./
|
|
6
|
-
import { t as d } from "./
|
|
3
|
+
import { t as s } from "./if-defined-r8tKY4tG.js";
|
|
4
|
+
import { t as c } from "./format-BTeSVkED.js";
|
|
5
|
+
import { n as l, t as u } from "./element-with-slot-COOwQUxM.js";
|
|
6
|
+
import { t as d } from "./classutils-DcYnSgfc.js";
|
|
7
|
+
import { t as f } from "./define-component-spec-BYOSeplU.js";
|
|
7
8
|
import "./icon-jEFbKTB_.js";
|
|
8
|
-
import "./button-
|
|
9
|
+
import "./button-Drwt7Qe5.js";
|
|
9
10
|
//#region ../../shared-types/aria.ts
|
|
10
|
-
var
|
|
11
|
+
var p = [
|
|
11
12
|
"off",
|
|
12
13
|
"polite",
|
|
13
14
|
"assertive"
|
|
14
|
-
],
|
|
15
|
+
], m = [
|
|
15
16
|
"info",
|
|
16
17
|
"success",
|
|
17
18
|
"warning",
|
|
18
19
|
"error"
|
|
19
|
-
],
|
|
20
|
+
], h = [
|
|
20
21
|
"medium",
|
|
21
22
|
"small",
|
|
22
23
|
"xsmall"
|
|
23
|
-
],
|
|
24
|
+
], g = f({
|
|
24
25
|
name: "pkt-alert",
|
|
25
26
|
react: "PktAlert",
|
|
26
27
|
"css-class": "pkt-alert",
|
|
@@ -47,7 +48,7 @@ var f = [
|
|
|
47
48
|
skin: {
|
|
48
49
|
name: "Utseende",
|
|
49
50
|
description: "Hvordan type melding er dette?",
|
|
50
|
-
type: [...
|
|
51
|
+
type: [...m],
|
|
51
52
|
default: "info",
|
|
52
53
|
category: "ui"
|
|
53
54
|
},
|
|
@@ -60,14 +61,14 @@ var f = [
|
|
|
60
61
|
ariaLive: {
|
|
61
62
|
name: "aria-live",
|
|
62
63
|
description: "Hvordan skal skjermleseren lese opp meldingen?",
|
|
63
|
-
type: [...
|
|
64
|
+
type: [...p],
|
|
64
65
|
default: "polite",
|
|
65
66
|
category: "accessibility"
|
|
66
67
|
},
|
|
67
68
|
size: {
|
|
68
69
|
name: "Størrelse",
|
|
69
70
|
description: "Endrer størrelsen på ulike elementer i alerten.",
|
|
70
|
-
type: [...
|
|
71
|
+
type: [...h],
|
|
71
72
|
default: "medium",
|
|
72
73
|
category: "ui"
|
|
73
74
|
},
|
|
@@ -87,9 +88,9 @@ var f = [
|
|
|
87
88
|
category: "ui",
|
|
88
89
|
default: !1
|
|
89
90
|
} }
|
|
90
|
-
}),
|
|
91
|
+
}), _ = class extends u {
|
|
91
92
|
constructor() {
|
|
92
|
-
super(), this.compact =
|
|
93
|
+
super(), this.compact = g.deprecated.compact.default, this.title = "", this.skin = g.props.skin.default, this.ariaLive = g.props.ariaLive.default, this.ariaLiveAttr = null, this.closeAlert = g.props.closeAlert.default, this.date = null, this.role = "status", this._hostId = null, this._isClosed = !1, this.close = (e) => {
|
|
93
94
|
this._isClosed = !0, this.dispatchEvent(new CustomEvent("close", {
|
|
94
95
|
detail: { origin: e },
|
|
95
96
|
bubbles: !0,
|
|
@@ -104,11 +105,16 @@ var f = [
|
|
|
104
105
|
connectedCallback() {
|
|
105
106
|
super.connectedCallback(), this.ariaLiveAttr = this.getAttribute("aria-live") || this.ariaLive;
|
|
106
107
|
}
|
|
108
|
+
willUpdate(e) {
|
|
109
|
+
super.willUpdate(e);
|
|
110
|
+
let t = this.getAttribute("id");
|
|
111
|
+
t && (this._hostId = t, this.removeAttribute("id"));
|
|
112
|
+
}
|
|
107
113
|
attributeChangedCallback(e, t, n) {
|
|
108
114
|
e === "ariaLive" && (this.ariaLiveAttr = n), super.attributeChangedCallback(e, t, n);
|
|
109
115
|
}
|
|
110
116
|
updated(e) {
|
|
111
|
-
super.updated(e), e.has("ariaLive") && (this.ariaLiveAttr = this.ariaLive), e.has("_isClosed") &&
|
|
117
|
+
super.updated(e), e.has("ariaLive") && e.get("ariaLive") !== void 0 && (this.ariaLiveAttr = this.ariaLive), e.has("_isClosed") && d(this, "pkt-hide", this._isClosed);
|
|
112
118
|
}
|
|
113
119
|
render() {
|
|
114
120
|
let t = this.size ?? (this.compact ? "small" : "medium"), r = {
|
|
@@ -122,7 +128,12 @@ var f = [
|
|
|
122
128
|
"pkt-alert__noDate": !this.date
|
|
123
129
|
};
|
|
124
130
|
return e`
|
|
125
|
-
<div
|
|
131
|
+
<div
|
|
132
|
+
class=${o(r)}
|
|
133
|
+
id=${s(this._hostId || void 0)}
|
|
134
|
+
aria-live=${this.ariaLiveAttr}
|
|
135
|
+
role=${this.role}
|
|
136
|
+
>
|
|
126
137
|
<div class=${o(i)}>
|
|
127
138
|
<pkt-icon
|
|
128
139
|
class="pkt-alert__icon"
|
|
@@ -148,10 +159,10 @@ var f = [
|
|
|
148
159
|
` : n}
|
|
149
160
|
${this.title ? e`<div class="pkt-alert__title">${this.title}</div>` : n}
|
|
150
161
|
|
|
151
|
-
<div class="pkt-alert__text">${
|
|
162
|
+
<div class="pkt-alert__text">${l(this)}</div>
|
|
152
163
|
|
|
153
164
|
${this.date ? e`<div class="pkt-alert__date">
|
|
154
|
-
${
|
|
165
|
+
${c(this.pktStrings.get("alert").lastUpdated, { date: this.date })}
|
|
155
166
|
</div>` : n}
|
|
156
167
|
</div>
|
|
157
168
|
</div>
|
|
@@ -161,36 +172,33 @@ var f = [
|
|
|
161
172
|
i([a({
|
|
162
173
|
type: Boolean,
|
|
163
174
|
reflect: !1
|
|
164
|
-
})],
|
|
175
|
+
})], _.prototype, "compact", void 0), i([a({
|
|
165
176
|
type: String,
|
|
166
177
|
reflect: !0
|
|
167
|
-
})],
|
|
178
|
+
})], _.prototype, "title", void 0), i([a({
|
|
168
179
|
type: String,
|
|
169
180
|
reflect: !0
|
|
170
|
-
})],
|
|
181
|
+
})], _.prototype, "skin", void 0), i([a({ type: String })], _.prototype, "ariaLive", void 0), i([a({
|
|
171
182
|
type: String,
|
|
172
183
|
reflect: !0,
|
|
173
184
|
attribute: "aria-live"
|
|
174
|
-
})],
|
|
185
|
+
})], _.prototype, "ariaLiveAttr", void 0), i([a({
|
|
175
186
|
type: Boolean,
|
|
176
187
|
reflect: !0
|
|
177
|
-
})],
|
|
178
|
-
type: String,
|
|
179
|
-
reflect: !0
|
|
180
|
-
})], g.prototype, "date", void 0), i([a({
|
|
188
|
+
})], _.prototype, "closeAlert", void 0), i([a({
|
|
181
189
|
type: String,
|
|
182
190
|
reflect: !0
|
|
183
|
-
})],
|
|
191
|
+
})], _.prototype, "date", void 0), i([a({ type: String })], _.prototype, "role", void 0), i([r()], _.prototype, "_hostId", void 0), i([a({
|
|
184
192
|
type: String,
|
|
185
193
|
attribute: "size"
|
|
186
|
-
})],
|
|
194
|
+
})], _.prototype, "size", void 0), i([r()], _.prototype, "_isClosed", void 0);
|
|
187
195
|
try {
|
|
188
|
-
t("pkt-alert")(
|
|
196
|
+
t("pkt-alert")(_);
|
|
189
197
|
} catch {
|
|
190
198
|
console.warn("Forsøker å definere <pkt-alert>, men den er allerede definert");
|
|
191
199
|
}
|
|
192
200
|
//#endregion
|
|
193
201
|
//#region src/components/alert/index.ts
|
|
194
|
-
var
|
|
202
|
+
var v = _;
|
|
195
203
|
//#endregion
|
|
196
|
-
export {
|
|
204
|
+
export { _ as n, v as t };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),n=require("./if-defined-BeVQnl3C.cjs"),r=require("./format-B8meU8Tm.cjs"),i=require("./element-with-slot-MkibfzHp.cjs"),a=require("./classutils-CbklAJDe.cjs"),o=require("./define-component-spec-DBNd2FJY.cjs");require("./icon-DBFTFd-J.cjs"),require("./button-jJfzE9C7.cjs");var s=[`off`,`polite`,`assertive`],c=[`info`,`success`,`warning`,`error`],l=[`medium`,`small`,`xsmall`],u=o.t({name:`pkt-alert`,react:`PktAlert`,"css-class":`pkt-alert`,"dark-mode":!0,isElement:!0,isPureReact:!0,events:{onClose:{reactOnly:!0,description:`React: Klikk-event for 'Lukk'-knappen`},close:{elementsOnly:!0,description:`Vue: Klikk-event for 'Lukk'-knappen`}},props:{title:{name:`Tittel`,description:`Tittelen som vises øverst i på meldingen`,type:`string`,category:`contents`},skin:{name:`Utseende`,description:`Hvordan type melding er dette?`,type:[...c],default:`info`,category:`ui`},date:{name:`Sist oppdatert`,description:`Dato som vises nederst i på meldingen`,type:`string`,category:`contents`},ariaLive:{name:`aria-live`,description:`Hvordan skal skjermleseren lese opp meldingen?`,type:[...s],default:`polite`,category:`accessibility`},size:{name:`Størrelse`,description:`Endrer størrelsen på ulike elementer i alerten.`,type:[...l],default:`medium`,category:`ui`},closeAlert:{name:`Vis 'Lukk'-knapp`,description:`Viser 'Lukk'-knappen`,type:`boolean`,default:!1,category:`ui`}},slots:{default:{description:`Innholdet i meldingen`}},deprecated:{compact:{name:`Kompakt (deprecated)`,description:"Bruk `size` i stedet; uten eksplisitt `size` gir compact størrelsen 'small'.",type:`boolean`,category:`ui`,default:!1}}}),d=class extends i.t{constructor(){super(),this.compact=u.deprecated.compact.default,this.title=``,this.skin=u.props.skin.default,this.ariaLive=u.props.ariaLive.default,this.ariaLiveAttr=null,this.closeAlert=u.props.closeAlert.default,this.date=null,this.role=`status`,this._hostId=null,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._isClosed=!1}connectedCallback(){super.connectedCallback(),this.ariaLiveAttr=this.getAttribute(`aria-live`)||this.ariaLive}willUpdate(e){super.willUpdate(e);let t=this.getAttribute(`id`);t&&(this._hostId=t,this.removeAttribute(`id`))}attributeChangedCallback(e,t,n){e===`ariaLive`&&(this.ariaLiveAttr=n),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`ariaLive`)&&e.get(`ariaLive`)!==void 0&&(this.ariaLiveAttr=this.ariaLive),e.has(`_isClosed`)&&a.t(this,`pkt-hide`,this._isClosed)}render(){let a=this.size??(this.compact?`small`:`medium`),o={"pkt-alert":!0,[`pkt-alert--${a}`]:!0,[`pkt-alert--${this.skin}`]:!0,"pkt-hide":this._isClosed},s={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return e._`
|
|
2
|
+
<div
|
|
3
|
+
class=${t.t(o)}
|
|
4
|
+
id=${n.t(this._hostId||void 0)}
|
|
5
|
+
aria-live=${this.ariaLiveAttr}
|
|
6
|
+
role=${this.role}
|
|
7
|
+
>
|
|
8
|
+
<div class=${t.t(s)}>
|
|
9
|
+
<pkt-icon
|
|
10
|
+
class="pkt-alert__icon"
|
|
11
|
+
aria-hidden="true"
|
|
12
|
+
name=${this.skin===`info`?`alert-information`:`alert-${this.skin}`}
|
|
13
|
+
></pkt-icon>
|
|
14
|
+
|
|
15
|
+
${this.closeAlert?e._`
|
|
16
|
+
<div class="pkt-alert__close">
|
|
17
|
+
<pkt-button
|
|
18
|
+
tabindex="0"
|
|
19
|
+
aria-label="close"
|
|
20
|
+
size=${a}
|
|
21
|
+
type="button"
|
|
22
|
+
skin="tertiary"
|
|
23
|
+
iconName="close"
|
|
24
|
+
variant="icon-only"
|
|
25
|
+
@click=${this.close}
|
|
26
|
+
>
|
|
27
|
+
<span class="sr-only">${this.pktStrings.get(`generic`).close}</span>
|
|
28
|
+
</pkt-button>
|
|
29
|
+
</div>
|
|
30
|
+
`:e.h}
|
|
31
|
+
${this.title?e._`<div class="pkt-alert__title">${this.title}</div>`:e.h}
|
|
32
|
+
|
|
33
|
+
<div class="pkt-alert__text">${i.n(this)}</div>
|
|
34
|
+
|
|
35
|
+
${this.date?e._`<div class="pkt-alert__date">
|
|
36
|
+
${r.t(this.pktStrings.get(`alert`).lastUpdated,{date:this.date})}
|
|
37
|
+
</div>`:e.h}
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
`}};e.n([e.u({type:Boolean,reflect:!1})],d.prototype,`compact`,void 0),e.n([e.u({type:String,reflect:!0})],d.prototype,`title`,void 0),e.n([e.u({type:String,reflect:!0})],d.prototype,`skin`,void 0),e.n([e.u({type:String})],d.prototype,`ariaLive`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`aria-live`})],d.prototype,`ariaLiveAttr`,void 0),e.n([e.u({type:Boolean,reflect:!0})],d.prototype,`closeAlert`,void 0),e.n([e.u({type:String,reflect:!0})],d.prototype,`date`,void 0),e.n([e.u({type:String})],d.prototype,`role`,void 0),e.n([e.l()],d.prototype,`_hostId`,void 0),e.n([e.u({type:String,attribute:`size`})],d.prototype,`size`,void 0),e.n([e.l()],d.prototype,`_isClosed`,void 0);try{e.d(`pkt-alert`)(d)}catch{console.warn(`Forsøker å definere <pkt-alert>, men den er allerede definert`)}var f=d;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-DRc10X2R.cjs")
|
|
1
|
+
const e=require("./element-DRc10X2R.cjs"),t=require("./if-defined-BeVQnl3C.cjs");require("./icon-DBFTFd-J.cjs");var n=class extends e.t{constructor(...e){super(...e),this.href=``,this.text=`Forsiden`,this.ariaLabel=null}attributeChangedCallback(e,t,n){e===`arialabel`&&this.removeAttribute(`arialabel`),e===`href`&&this.removeAttribute(`href`),e===`text`&&this.removeAttribute(`text`),super.attributeChangedCallback(e,t,n)}render(){return e._`<nav
|
|
2
2
|
class="pkt-back-link"
|
|
3
3
|
aria-label=${this.ariaLabel||this.pktStrings.get(`backlink`).label}
|
|
4
4
|
>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-e2MAMNEP.js";
|
|
2
2
|
import { t as o } from "./class-map-BL_YL_Ed.js";
|
|
3
|
-
import {
|
|
3
|
+
import { t as s } from "./if-defined-r8tKY4tG.js";
|
|
4
|
+
import { n as c, t as l } from "./element-with-slot-COOwQUxM.js";
|
|
4
5
|
import "./icon-jEFbKTB_.js";
|
|
5
|
-
import { t as l } from "./if-defined-r8tKY4tG.js";
|
|
6
6
|
//#region src/components/button/button.ts
|
|
7
7
|
var u = "https://punkt-cdn.oslo.kommune.no/latest/animations/";
|
|
8
8
|
typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || u);
|
|
9
|
-
var d = class t extends
|
|
9
|
+
var d = class t extends l {
|
|
10
10
|
constructor(...e) {
|
|
11
|
-
super(...e), this.iconName = "user", this.secondIconName = "user", this.
|
|
11
|
+
super(...e), this.iconName = "user", this.secondIconName = "user", this.size = "medium", this.fullWidth = !1, this.fullWidthOnMobile = !1, this.skin = "primary", this.variant = "label-only", this.state = void 0, this.type = "button", this.form = void 0, this.isLoading = !1, this.disabled = !1, this.loadingAnimationPath = typeof window < "u" ? window.pktAnimationPath : u, this.relocatedAria = {};
|
|
12
12
|
}
|
|
13
13
|
connectedCallback() {
|
|
14
14
|
super.connectedCallback(), this.addEventListener("click", (e) => {
|
|
@@ -24,7 +24,9 @@ var d = class t extends c {
|
|
|
24
24
|
this.relocatedAriaAttributes = [
|
|
25
25
|
"aria-haspopup",
|
|
26
26
|
"aria-expanded",
|
|
27
|
-
"aria-controls"
|
|
27
|
+
"aria-controls",
|
|
28
|
+
"aria-label",
|
|
29
|
+
"tabindex"
|
|
28
30
|
];
|
|
29
31
|
}
|
|
30
32
|
willUpdate(e) {
|
|
@@ -49,7 +51,6 @@ var d = class t extends c {
|
|
|
49
51
|
[`pkt-btn--${this.state}`]: !!this.state,
|
|
50
52
|
"pkt-btn--full": !!this.fullWidth,
|
|
51
53
|
"pkt-btn--full-small": !!this.fullWidthOnMobile,
|
|
52
|
-
"pkt-btn--disabled": !!this.disabled,
|
|
53
54
|
"pkt-btn--isLoading": !!this.isLoading
|
|
54
55
|
};
|
|
55
56
|
return e`
|
|
@@ -57,34 +58,36 @@ var d = class t extends c {
|
|
|
57
58
|
class=${o(r)}
|
|
58
59
|
type=${this.type}
|
|
59
60
|
?disabled=${!!this.disabled}
|
|
60
|
-
aria-busy=${
|
|
61
|
-
aria-disabled=${
|
|
62
|
-
aria-haspopup=${
|
|
63
|
-
aria-expanded=${
|
|
64
|
-
aria-controls=${
|
|
65
|
-
|
|
61
|
+
aria-busy=${s(this.isLoading ? "true" : void 0)}
|
|
62
|
+
aria-disabled=${s(this.disabled || this.isLoading ? "true" : void 0)}
|
|
63
|
+
aria-haspopup=${s(this.relocatedAria["aria-haspopup"])}
|
|
64
|
+
aria-expanded=${s(this.relocatedAria["aria-expanded"])}
|
|
65
|
+
aria-controls=${s(this.relocatedAria["aria-controls"])}
|
|
66
|
+
aria-label=${s(this.relocatedAria["aria-label"])}
|
|
67
|
+
tabindex=${s(this.relocatedAria.tabindex)}
|
|
68
|
+
form=${s(t)}
|
|
66
69
|
>
|
|
67
70
|
${this.isLoading ? e`<pkt-icon
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
class="pkt-btn__icon pkt-btn__spinner"
|
|
72
|
+
name="spinner-blue"
|
|
73
|
+
path=${s(this.loadingAnimationPath)}
|
|
74
|
+
></pkt-icon>` : n}
|
|
72
75
|
${this.variant === "label-only" ? n : e`<pkt-icon
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
<span class="pkt-btn__text">${
|
|
76
|
+
class="pkt-btn__icon pkt-icon"
|
|
77
|
+
name=${this.iconName}
|
|
78
|
+
path=${s(this.iconPath)}
|
|
79
|
+
></pkt-icon>`}
|
|
80
|
+
<span class="pkt-btn__text">${c(this)}</span>
|
|
78
81
|
${this.variant === "icons-right-and-left" ? e`<pkt-icon
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
class="pkt-btn__icon"
|
|
83
|
+
name=${this.secondIconName}
|
|
84
|
+
path=${s(this.secondIconPath)}
|
|
85
|
+
></pkt-icon>` : n}
|
|
83
86
|
</button>
|
|
84
87
|
`;
|
|
85
88
|
}
|
|
86
89
|
};
|
|
87
|
-
i([a({ type: String })], d.prototype, "iconName", void 0), i([a({ type: String })], d.prototype, "secondIconName", void 0), i([a({ type: String })], d.prototype, "iconPath", void 0), i([a({ type: String })], d.prototype, "secondIconPath", void 0), i([a({ type: String })], d.prototype, "
|
|
90
|
+
i([a({ type: String })], d.prototype, "iconName", void 0), i([a({ type: String })], d.prototype, "secondIconName", void 0), i([a({ type: String })], d.prototype, "iconPath", void 0), i([a({ type: String })], d.prototype, "secondIconPath", void 0), i([a({ type: String })], d.prototype, "size", void 0), i([a({
|
|
88
91
|
type: Boolean,
|
|
89
92
|
attribute: "full-width"
|
|
90
93
|
})], d.prototype, "fullWidth", void 0), i([a({
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const e=require("./element-DRc10X2R.cjs"),t=require("./class-map-BEib48YL.cjs"),n=require("./if-defined-BeVQnl3C.cjs"),r=require("./element-with-slot-MkibfzHp.cjs");require("./icon-DBFTFd-J.cjs");var i=`https://punkt-cdn.oslo.kommune.no/latest/animations/`;typeof window<`u`&&(window.pktAnimationPath=window.pktAnimationPath||i);var a=class a extends r.t{constructor(...e){super(...e),this.iconName=`user`,this.secondIconName=`user`,this.size=`medium`,this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin=`primary`,this.variant=`label-only`,this.state=void 0,this.type=`button`,this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=typeof window<`u`?window.pktAnimationPath:i,this.relocatedAria={}}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener(`keydown`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`disabled`&&n===`false`&&(this.disabled=!1),(e===`isloading`||e===`isLoading`)&&n===`false`&&(this.isLoading=!1)}static{this.relocatedAriaAttributes=[`aria-haspopup`,`aria-expanded`,`aria-controls`,`aria-label`,`tabindex`]}willUpdate(e){super.willUpdate(e);let t=!1,n={...this.relocatedAria};for(let e of a.relocatedAriaAttributes){let r=this.getAttribute(e);r!==null&&(n[e]=r,this.removeAttribute(e),t=!0)}t&&(this.relocatedAria=n)}firstUpdated(e){super.firstUpdated(e),this.disabled===`false`&&(this.disabled=!1),this.isLoading===`false`&&(this.isLoading=!1)}render(){let i=this.form??this.getAttribute(`form`)??void 0,a={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--isLoading":!!this.isLoading};return e._`
|
|
2
|
+
<button
|
|
3
|
+
class=${t.t(a)}
|
|
4
|
+
type=${this.type}
|
|
5
|
+
?disabled=${!!this.disabled}
|
|
6
|
+
aria-busy=${n.t(this.isLoading?`true`:void 0)}
|
|
7
|
+
aria-disabled=${n.t(this.disabled||this.isLoading?`true`:void 0)}
|
|
8
|
+
aria-haspopup=${n.t(this.relocatedAria[`aria-haspopup`])}
|
|
9
|
+
aria-expanded=${n.t(this.relocatedAria[`aria-expanded`])}
|
|
10
|
+
aria-controls=${n.t(this.relocatedAria[`aria-controls`])}
|
|
11
|
+
aria-label=${n.t(this.relocatedAria[`aria-label`])}
|
|
12
|
+
tabindex=${n.t(this.relocatedAria.tabindex)}
|
|
13
|
+
form=${n.t(i)}
|
|
14
|
+
>
|
|
15
|
+
${this.isLoading?e._`<pkt-icon
|
|
16
|
+
class="pkt-btn__icon pkt-btn__spinner"
|
|
17
|
+
name="spinner-blue"
|
|
18
|
+
path=${n.t(this.loadingAnimationPath)}
|
|
19
|
+
></pkt-icon>`:e.h}
|
|
20
|
+
${this.variant===`label-only`?e.h:e._`<pkt-icon
|
|
21
|
+
class="pkt-btn__icon pkt-icon"
|
|
22
|
+
name=${this.iconName}
|
|
23
|
+
path=${n.t(this.iconPath)}
|
|
24
|
+
></pkt-icon>`}
|
|
25
|
+
<span class="pkt-btn__text">${r.n(this)}</span>
|
|
26
|
+
${this.variant===`icons-right-and-left`?e._`<pkt-icon
|
|
27
|
+
class="pkt-btn__icon"
|
|
28
|
+
name=${this.secondIconName}
|
|
29
|
+
path=${n.t(this.secondIconPath)}
|
|
30
|
+
></pkt-icon>`:e.h}
|
|
31
|
+
</button>
|
|
32
|
+
`}};e.n([e.u({type:String})],a.prototype,`iconName`,void 0),e.n([e.u({type:String})],a.prototype,`secondIconName`,void 0),e.n([e.u({type:String})],a.prototype,`iconPath`,void 0),e.n([e.u({type:String})],a.prototype,`secondIconPath`,void 0),e.n([e.u({type:String})],a.prototype,`size`,void 0),e.n([e.u({type:Boolean,attribute:`full-width`})],a.prototype,`fullWidth`,void 0),e.n([e.u({type:Boolean,attribute:`full-width-on-mobile`})],a.prototype,`fullWidthOnMobile`,void 0),e.n([e.u({type:String})],a.prototype,`color`,void 0),e.n([e.u({type:String})],a.prototype,`skin`,void 0),e.n([e.u({type:String})],a.prototype,`variant`,void 0),e.n([e.u({type:String,reflect:!0})],a.prototype,`state`,void 0),e.n([e.u({type:String,reflect:!0})],a.prototype,`type`,void 0),e.n([e.u({type:String})],a.prototype,`form`,void 0),e.n([e.u({type:Boolean,reflect:!0})],a.prototype,`isLoading`,void 0),e.n([e.u({type:Boolean,reflect:!0})],a.prototype,`disabled`,void 0),e.n([e.u({type:String})],a.prototype,`loadingAnimationPath`,void 0),e.n([e.l()],a.prototype,`relocatedAria`,void 0);try{e.d(`pkt-button`)(a)}catch{console.warn(`Forsøker å definere <pkt-button>, men den er allerede definert`)}var o=a;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|