@oslokommune/punkt-elements 16.7.1 → 16.7.4
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 +35 -0
- package/dist/accordion-BB1JrONI.cjs +34 -0
- package/dist/accordion-nNH87Y60.js +130 -0
- package/dist/alert-BEEnTiCb.cjs +33 -0
- package/dist/alert-ePJuDtmm.js +171 -0
- package/dist/async-directive-B9P1Qa0k.cjs +1 -0
- package/dist/async-directive-CaQiqjyV.js +55 -0
- package/dist/backlink-Ba03LlbB.cjs +13 -0
- package/dist/backlink-CiwXrQYD.js +38 -0
- package/dist/booleanish-BmcOU-43.js +11 -0
- package/dist/booleanish-jJLlnr6-.cjs +1 -0
- package/dist/breadcrumbs-CD1zib3s.cjs +43 -0
- package/dist/breadcrumbs-CpuVqWhF.js +76 -0
- package/dist/button-BIpd1xJh.js +95 -0
- package/dist/button-D-TOBaJB.cjs +27 -0
- package/dist/calendar-BzEtOJla.js +2031 -0
- package/dist/calendar-E5jJLt8D.cjs +90 -0
- package/dist/card-BYJu1MYm.js +339 -0
- package/dist/card-CUFhMVim.cjs +87 -0
- package/dist/checkbox-BARDb9iV.cjs +31 -0
- package/dist/checkbox-Cspxcvt_.js +111 -0
- package/dist/class-map-C8HuhNzZ.js +27 -0
- package/dist/class-map-CJ-msbHs.cjs +1 -0
- package/dist/classutils-DEL164Ur.js +7 -0
- package/dist/classutils-z8YsPlOf.cjs +1 -0
- package/dist/combobox-BcdLZRDU.js +984 -0
- package/dist/combobox-CGbFTWq_.cjs +135 -0
- package/dist/consent-DeB_5sWH.js +197 -0
- package/dist/consent-hwu7pp3S.cjs +11 -0
- package/dist/datepicker-DpmlsnH_.cjs +273 -0
- package/dist/datepicker-OVd8pmnZ.js +1125 -0
- package/dist/dialog-polyfill.esm-1hPr0gl9.js +280 -0
- package/dist/dialog-polyfill.esm-D3Oinvk0.cjs +1 -0
- package/dist/directive-3THFsVew.js +28 -0
- package/dist/directive-CJ2giQBZ.cjs +1 -0
- package/dist/directive-helpers-D1QSxY17.cjs +1 -0
- package/dist/directive-helpers-Dkv2gKgs.js +25 -0
- package/dist/element-DjtxO-1r.cjs +2 -0
- package/dist/element-cZ85T_aa.js +693 -0
- package/dist/element-with-slot-4J2o3SeU.js +166 -0
- package/dist/element-with-slot-CWoTGA1B.cjs +1 -0
- package/dist/header-DWgPgGfS.cjs +304 -0
- package/dist/header-a6ztVNp3.js +782 -0
- package/dist/heading-BgSWIRii.cjs +1 -0
- package/dist/heading-DiQLPxdf.js +73 -0
- package/dist/helptext-CCBKKLus.js +65 -0
- package/dist/helptext-D-3QfZv5.cjs +24 -0
- package/dist/icon-Co72KtgF.js +86 -0
- package/dist/icon-Dr8sfT2X.cjs +1 -0
- package/dist/if-defined-Cjj8qN-Z.js +5 -0
- package/dist/if-defined-XKOD_t_V.cjs +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/input-element-B1yxcfz4.cjs +1 -0
- package/dist/input-element-Bw1s6NlF.js +643 -0
- package/dist/input-wrapper-BRuVELpK.cjs +54 -0
- package/dist/input-wrapper-CDyHTR1V.js +164 -0
- package/dist/input-wrapper-Dwd-_sKm.cjs +1 -0
- package/dist/input-wrapper-YfTmpSSY.js +117 -0
- package/dist/link-CKAFMz9j.js +89 -0
- package/dist/link-CyTCpI0k.cjs +7 -0
- package/dist/linkcard-B0KOGaGj.js +55 -0
- package/dist/linkcard-BE4-FewK.cjs +13 -0
- package/dist/listbox-DCA2JoPV.cjs +106 -0
- package/dist/listbox-DuBgTFvH.js +397 -0
- package/dist/loader-6kFZUErT.js +66 -0
- package/dist/loader-CX2rsC01.cjs +16 -0
- package/dist/messagebox-Cwlg5sOr.js +110 -0
- package/dist/messagebox-Din9X53b.cjs +13 -0
- package/dist/modal-C_wtsh9m.js +209 -0
- package/dist/modal-DS_wUOIv.cjs +36 -0
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -7
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +2 -6
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +2 -6
- package/dist/pkt-breadcrumbs.cjs +1 -43
- package/dist/pkt-breadcrumbs.js +2 -79
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +2 -6
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +2 -6
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +2 -6
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +2 -6
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +2 -6
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +2 -6
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +5 -10
- package/dist/pkt-header.cjs +1 -304
- package/dist/pkt-header.js +2 -855
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +2 -6
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +2 -6
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +2 -6
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +30 -66
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +2 -6
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +2 -6
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +2 -6
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +2 -6
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +2 -6
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +2 -6
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +2 -6
- package/dist/pkt-options-controller-CRrI6WMk.js +43 -0
- package/dist/pkt-options-controller-CXUGx134.cjs +1 -0
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -6
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +2 -6
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +2 -6
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +2 -7
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +2 -6
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +2 -6
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +2 -6
- package/dist/pkt-timepicker.cjs +1 -191
- package/dist/pkt-timepicker.js +2 -558
- package/dist/progressbar-CdXtmOBb.cjs +17 -0
- package/dist/progressbar-Dy9AiYQz.js +113 -0
- package/dist/radiobutton-GOnpUbCW.cjs +31 -0
- package/dist/radiobutton-V_KPbup_.js +84 -0
- package/dist/ref-BaJ0mBT_.cjs +1 -0
- package/dist/ref-RS8Uv6uC.js +30 -0
- package/dist/repeat-Cepr3469.js +57 -0
- package/dist/repeat-CqcDYBxr.cjs +1 -0
- package/dist/select-BSAFd8Wa.js +164 -0
- package/dist/select-C2i8sOk5.cjs +49 -0
- package/dist/tabs-D8nL9rWx.cjs +37 -0
- package/dist/tabs-Y7utmJi9.js +318 -0
- package/dist/tag-DLthw5b4.cjs +27 -0
- package/dist/tag-VwykmuQR.js +179 -0
- package/dist/textarea-D7aGOyDf.cjs +46 -0
- package/dist/textarea-DYOBhJrN.js +115 -0
- package/dist/textinput-BUgntXnM.js +124 -0
- package/dist/textinput-DFh8_9cx.cjs +70 -0
- package/dist/timepicker-BIfE7KKJ.cjs +191 -0
- package/dist/timepicker-DaSwn1FA.js +503 -0
- package/dist/utils-CUqCKGvp.js +7 -0
- package/dist/utils-CjAbIttF.cjs +1 -0
- package/package.json +6 -6
- package/src/components/accordion/accordion.ts +6 -1
- package/src/components/accordion/accordionitem.ts +6 -1
- package/src/components/alert/alert.test.ts +1 -1
- package/src/components/alert/alert.ts +12 -7
- package/src/components/backlink/backlink.ts +6 -1
- package/src/components/breadcrumbs/breadcrumbs.ts +6 -1
- package/src/components/button/button.ts +6 -1
- package/src/components/calendar/calendar.ts +6 -1
- package/src/components/card/card.ts +6 -1
- package/src/components/checkbox/checkbox.ts +6 -1
- package/src/components/combobox/combobox.ts +6 -1
- package/src/components/consent/consent.ts +6 -1
- package/src/components/datepicker/date-tags.ts +6 -1
- package/src/components/datepicker/datepicker-multiple.ts +6 -1
- package/src/components/datepicker/datepicker-popup.ts +6 -1
- package/src/components/datepicker/datepicker-range.ts +6 -1
- package/src/components/datepicker/datepicker-single.ts +6 -1
- package/src/components/datepicker/datepicker-utils.test.ts +16 -23
- package/src/components/datepicker/datepicker.ts +6 -1
- package/src/components/header/header-service.ts +6 -1
- package/src/components/header/header-user-menu.ts +6 -1
- package/src/components/header/header.ts +6 -1
- package/src/components/heading/heading.ts +6 -1
- package/src/components/helptext/helptext.ts +6 -1
- package/src/components/icon/icon.ts +6 -1
- package/src/components/input-wrapper/input-wrapper.ts +6 -1
- package/src/components/link/link.ts +6 -1
- package/src/components/linkcard/linkcard.ts +6 -1
- package/src/components/listbox/listbox.ts +6 -1
- package/src/components/loader/loader.ts +6 -1
- package/src/components/messagebox/messagebox.ts +6 -1
- package/src/components/modal/modal.ts +6 -1
- package/src/components/progressbar/progressbar.ts +6 -1
- package/src/components/radiobutton/radiobutton.ts +6 -1
- package/src/components/select/select.ts +6 -1
- package/src/components/tabs/tabitem.ts +6 -1
- package/src/components/tabs/tabs.ts +6 -1
- package/src/components/tag/tag.ts +6 -1
- package/src/components/textarea/textarea.ts +6 -1
- package/src/components/textinput/textinput.ts +6 -1
- package/src/components/timepicker/timepicker.ts +6 -1
- package/dist/accordionitem-D1Agl1bB.cjs +0 -34
- package/dist/accordionitem-ZlaXvjt5.js +0 -138
- package/dist/alert-BuAXrnKl.js +0 -115
- package/dist/alert-DFkFNTxh.cjs +0 -33
- package/dist/async-directive-CMzWMlZ5.js +0 -65
- package/dist/async-directive-DoMuclel.cjs +0 -5
- package/dist/backlink-EiAXUUZP.cjs +0 -13
- package/dist/backlink-V4DAt17e.js +0 -47
- package/dist/booleanish-BKVonob4.cjs +0 -1
- package/dist/booleanish-C9R0tdXH.js +0 -11
- package/dist/button-DEyvt1LI.js +0 -137
- package/dist/button-DYv5Dg4M.cjs +0 -27
- package/dist/calendar-HIE9nxcc.cjs +0 -90
- package/dist/calendar-S63oreVW.js +0 -2138
- package/dist/card-CyeH6l1c.cjs +0 -87
- package/dist/card-DDiLfuO4.js +0 -231
- package/dist/checkbox-BLlwTABj.cjs +0 -31
- package/dist/checkbox-ejBUa5qQ.js +0 -145
- package/dist/class-map-CEnykyO_.js +0 -34
- package/dist/class-map-CsENJXf1.cjs +0 -5
- package/dist/classutils-BwNK82ZQ.cjs +0 -1
- package/dist/classutils-RQs1k6D9.js +0 -7
- package/dist/combobox-BmxSecfE.js +0 -818
- package/dist/combobox-Hb2V-fPX.cjs +0 -135
- package/dist/consent-iXyx5v6J.js +0 -173
- package/dist/consent-ruWAEVXW.cjs +0 -11
- package/dist/datepicker-CZl7b8Na.js +0 -1158
- package/dist/datepicker-D2H7U6MS.cjs +0 -273
- package/dist/dialog-polyfill.esm-CPKZe7AL.cjs +0 -1
- package/dist/dialog-polyfill.esm-CbjBMXAG.js +0 -395
- package/dist/directive-C7oCP5Bh.cjs +0 -5
- package/dist/directive-helpers-BP2WOx60.cjs +0 -5
- package/dist/directive-helpers-rm-28gIj.js +0 -38
- package/dist/directive-oAbCiebi.js +0 -27
- package/dist/element-CPpT3rFQ.js +0 -638
- package/dist/element-gR_VtSiD.cjs +0 -27
- package/dist/element-with-slot-Dqk6-TRR.js +0 -240
- package/dist/element-with-slot-ZX-up7jO.cjs +0 -1
- package/dist/heading-CKt7cVn7.js +0 -101
- package/dist/heading-Cvz8m1xL.cjs +0 -1
- package/dist/helptext-5Mzp65-F.cjs +0 -24
- package/dist/helptext-jIoWRcCF.js +0 -80
- package/dist/icon-BlKA8YuW.js +0 -103
- package/dist/icon-Bqj9oBbl.cjs +0 -9
- package/dist/if-defined-B0krMLad.js +0 -10
- package/dist/if-defined-BOW3ODSj.cjs +0 -5
- package/dist/input-element-8nLwuQS4.js +0 -837
- package/dist/input-element-DdVhUvva.cjs +0 -1
- package/dist/input-wrapper-B0MkQ0IZ.cjs +0 -54
- package/dist/input-wrapper-B2JpK016.js +0 -179
- package/dist/input-wrapper-CDgenrYA.js +0 -6
- package/dist/input-wrapper-EoSAbU-U.cjs +0 -1
- package/dist/link-R_lNhViF.cjs +0 -7
- package/dist/link-Z_GizclR.js +0 -53
- package/dist/linkcard-BlQvdB1a.js +0 -54
- package/dist/linkcard-C7HbSLlX.cjs +0 -13
- package/dist/listbox-BQKDZvZn.js +0 -438
- package/dist/listbox-CGgV9MAe.cjs +0 -106
- package/dist/loader-Ci3CHU8k.js +0 -93
- package/dist/loader-e2gs_1xz.cjs +0 -16
- package/dist/messagebox-Bf-XMlvW.js +0 -69
- package/dist/messagebox-D67w71VX.cjs +0 -13
- package/dist/modal-CyvEkbfQ.cjs +0 -36
- package/dist/modal-DzGe1g8Z.js +0 -154
- package/dist/pkt-options-controller-5LXbEzuk.cjs +0 -1
- package/dist/pkt-options-controller-B5YalfCb.js +0 -39
- package/dist/progressbar-By7e0lEI.js +0 -162
- package/dist/progressbar-DsJ2B9Vm.cjs +0 -21
- package/dist/radiobutton-6frNG9J_.js +0 -111
- package/dist/radiobutton-Bv-BZ1Hw.cjs +0 -31
- package/dist/ref-Bg_Swj5w.js +0 -42
- package/dist/ref-CL-Xk9Xm.cjs +0 -5
- package/dist/repeat-BD8TKgJb.js +0 -61
- package/dist/repeat-Cfq8CDlf.cjs +0 -5
- package/dist/select-CXZt1nHS.js +0 -228
- package/dist/select-WFhS4Vfp.cjs +0 -49
- package/dist/state-C_1EOo3D.js +0 -12
- package/dist/state-Dg-53wQ8.cjs +0 -5
- package/dist/tabitem-CB8wkKmv.js +0 -332
- package/dist/tabitem-DZpspU4Q.cjs +0 -65
- package/dist/tag-BuCpqaks.js +0 -115
- package/dist/tag-X6xdjR0N.cjs +0 -27
- package/dist/textarea-Bzuymclz.js +0 -131
- package/dist/textarea-DoeHJ7HR.cjs +0 -50
- package/dist/textinput-9lHjs4ce.js +0 -150
- package/dist/textinput-BNsLd26i.cjs +0 -70
- package/dist/utils-DznhwRXm.js +0 -8
- package/dist/utils-byXsEz1u.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,41 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [16.7.4](https://github.com/oslokommune/punkt/compare/16.7.3...16.7.4) (2026-04-14)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
* Vite => 8.0.8 & Vitest => 4.1.4 & TypeScript => 6.0.2 (#3418).
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
Ingen
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## [16.7.3](https://github.com/oslokommune/punkt/compare/16.7.2...16.7.3) (2026-04-14)
|
|
27
|
+
|
|
28
|
+
### ⚠ BREAKING CHANGES
|
|
29
|
+
Ingen
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
Ingen
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
Ingen
|
|
36
|
+
|
|
37
|
+
### Chores
|
|
38
|
+
Ingen
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
|
|
8
43
|
## [16.7.1](https://github.com/oslokommune/punkt/compare/16.7.0...16.7.1) (2026-04-13)
|
|
9
44
|
|
|
10
45
|
### ⚠ BREAKING CHANGES
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),n=require(`./element-with-slot-CWoTGA1B.cjs`),r=require(`./if-defined-XKOD_t_V.cjs`),i=require(`./ref-BaJ0mBT_.cjs`);var a=class extends e.a{constructor(...e){super(...e),this.ariaLabelledBy=``,this.compact=!1,this.skin=`borderless`,this.name=``}updated(e){e.has(`skin`)&&this.requestUpdate(),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(){return e.d`
|
|
2
|
+
<div
|
|
3
|
+
part="container"
|
|
4
|
+
class=${t.t({"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin})}
|
|
5
|
+
data-testid="pkt-accordion"
|
|
6
|
+
aria-labelledby=${this.ariaLabelledBy}
|
|
7
|
+
>
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</div>
|
|
10
|
+
`}};e.r([e.s({type:String,reflect:!0,attribute:`aria-labelledby`})],a.prototype,`ariaLabelledBy`,void 0),e.r([e.s({type:Boolean,reflect:!0,attribute:`compact`})],a.prototype,`compact`,void 0),e.r([e.s({type:String,reflect:!0,attribute:`skin`})],a.prototype,`skin`,void 0),e.r([e.s({type:String,reflect:!0,attribute:`name`})],a.prototype,`name`,void 0);try{e.c(`pkt-accordion`)(a)}catch{console.warn(`Forsøker å definere <pkt-accordion>, men den er allerede definert`)}var o=class extends n.t{constructor(){super(),this.defaultOpen=!1,this.title=``,this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=i.t()}firstUpdated(e){this.defaultOpen&&(this.isOpen=!0)}render(){return e.d`
|
|
11
|
+
<details
|
|
12
|
+
class=${t.t({"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin})}
|
|
13
|
+
id=${this.id}
|
|
14
|
+
?open=${this.isOpen}
|
|
15
|
+
${i.n(this.accordionItemRef)}
|
|
16
|
+
name=${r.t(this.name)}
|
|
17
|
+
>
|
|
18
|
+
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
19
|
+
${this.title}
|
|
20
|
+
<pkt-icon
|
|
21
|
+
name="chevron-thin-down"
|
|
22
|
+
class="pkt-accordion-item__icon"
|
|
23
|
+
aria-hidden="true"
|
|
24
|
+
></pkt-icon>
|
|
25
|
+
</summary>
|
|
26
|
+
<div
|
|
27
|
+
class="pkt-accordion-item__content"
|
|
28
|
+
id="pkt-accordion-item__content-${this.id}"
|
|
29
|
+
role="region"
|
|
30
|
+
>
|
|
31
|
+
<div class="pkt-accordion-item__content-inner">${n.n(this)}</div>
|
|
32
|
+
</div>
|
|
33
|
+
</details>
|
|
34
|
+
`}};e.r([e.s({type:Boolean})],o.prototype,`defaultOpen`,void 0),e.r([e.s({type:String})],o.prototype,`title`,void 0),e.r([e.s({type:String,reflect:!0})],o.prototype,`skin`,void 0),e.r([e.s({type:Boolean,reflect:!0})],o.prototype,`compact`,void 0),e.r([e.s({type:Boolean,reflect:!0})],o.prototype,`isOpen`,void 0),e.r([e.s({type:String,reflect:!0})],o.prototype,`name`,void 0);try{e.c(`pkt-accordion-item`)(o)}catch{console.warn(`Forsøker å definere <pkt-accordion-item>, men den er allerede definert`)}var s=a;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { a as e, c as t, d as n, r, s as i } from "./element-cZ85T_aa.js";
|
|
2
|
+
import { t as a } from "./class-map-C8HuhNzZ.js";
|
|
3
|
+
import { n as o, t as s } from "./element-with-slot-4J2o3SeU.js";
|
|
4
|
+
import { t as c } from "./if-defined-Cjj8qN-Z.js";
|
|
5
|
+
import { n as l, t as u } from "./ref-RS8Uv6uC.js";
|
|
6
|
+
//#region src/components/accordion/accordion.ts
|
|
7
|
+
var d = class extends e {
|
|
8
|
+
constructor(...e) {
|
|
9
|
+
super(...e), this.ariaLabelledBy = "", this.compact = !1, this.skin = "borderless", this.name = "";
|
|
10
|
+
}
|
|
11
|
+
updated(e) {
|
|
12
|
+
e.has("skin") && this.requestUpdate(), e.has("name") && this.updateAccordionItemNames();
|
|
13
|
+
}
|
|
14
|
+
updateAccordionItemNames() {
|
|
15
|
+
if (this.name) {
|
|
16
|
+
let e = this.renderRoot?.querySelector("slot");
|
|
17
|
+
e && e.assignedElements().forEach((e) => {
|
|
18
|
+
e.tagName.toLowerCase() === "pkt-accordion-item" && (e.hasAttribute("name") || e.setAttribute("name", this.name));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
firstUpdated() {
|
|
23
|
+
let e = this.renderRoot?.querySelector("slot");
|
|
24
|
+
e && e.addEventListener("slotchange", () => {
|
|
25
|
+
this.updateAccordionItemNames();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
return n`
|
|
30
|
+
<div
|
|
31
|
+
part="container"
|
|
32
|
+
class=${a({
|
|
33
|
+
"pkt-accordion": !0,
|
|
34
|
+
"pkt-accordion--compact": this.compact,
|
|
35
|
+
[`pkt-accordion--${this.skin}`]: this.skin
|
|
36
|
+
})}
|
|
37
|
+
data-testid="pkt-accordion"
|
|
38
|
+
aria-labelledby=${this.ariaLabelledBy}
|
|
39
|
+
>
|
|
40
|
+
<slot></slot>
|
|
41
|
+
</div>
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
r([i({
|
|
46
|
+
type: String,
|
|
47
|
+
reflect: !0,
|
|
48
|
+
attribute: "aria-labelledby"
|
|
49
|
+
})], d.prototype, "ariaLabelledBy", void 0), r([i({
|
|
50
|
+
type: Boolean,
|
|
51
|
+
reflect: !0,
|
|
52
|
+
attribute: "compact"
|
|
53
|
+
})], d.prototype, "compact", void 0), r([i({
|
|
54
|
+
type: String,
|
|
55
|
+
reflect: !0,
|
|
56
|
+
attribute: "skin"
|
|
57
|
+
})], d.prototype, "skin", void 0), r([i({
|
|
58
|
+
type: String,
|
|
59
|
+
reflect: !0,
|
|
60
|
+
attribute: "name"
|
|
61
|
+
})], d.prototype, "name", void 0);
|
|
62
|
+
try {
|
|
63
|
+
t("pkt-accordion")(d);
|
|
64
|
+
} catch {
|
|
65
|
+
console.warn("Forsøker å definere <pkt-accordion>, men den er allerede definert");
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/components/accordion/accordionitem.ts
|
|
69
|
+
var f = class extends s {
|
|
70
|
+
constructor() {
|
|
71
|
+
super(), this.defaultOpen = !1, this.title = "", this.skin = void 0, this.compact = !1, this.isOpen = !1, this.name = void 0, this.accordionItemRef = u();
|
|
72
|
+
}
|
|
73
|
+
firstUpdated(e) {
|
|
74
|
+
this.defaultOpen && (this.isOpen = !0);
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
return n`
|
|
78
|
+
<details
|
|
79
|
+
class=${a({
|
|
80
|
+
"pkt-accordion-item": !0,
|
|
81
|
+
"pkt-accordion-item--compact": this.compact,
|
|
82
|
+
[`pkt-accordion-item--${this.skin}`]: !!this.skin
|
|
83
|
+
})}
|
|
84
|
+
id=${this.id}
|
|
85
|
+
?open=${this.isOpen}
|
|
86
|
+
${l(this.accordionItemRef)}
|
|
87
|
+
name=${c(this.name)}
|
|
88
|
+
>
|
|
89
|
+
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
90
|
+
${this.title}
|
|
91
|
+
<pkt-icon
|
|
92
|
+
name="chevron-thin-down"
|
|
93
|
+
class="pkt-accordion-item__icon"
|
|
94
|
+
aria-hidden="true"
|
|
95
|
+
></pkt-icon>
|
|
96
|
+
</summary>
|
|
97
|
+
<div
|
|
98
|
+
class="pkt-accordion-item__content"
|
|
99
|
+
id="pkt-accordion-item__content-${this.id}"
|
|
100
|
+
role="region"
|
|
101
|
+
>
|
|
102
|
+
<div class="pkt-accordion-item__content-inner">${o(this)}</div>
|
|
103
|
+
</div>
|
|
104
|
+
</details>
|
|
105
|
+
`;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
r([i({ type: Boolean })], f.prototype, "defaultOpen", void 0), r([i({ type: String })], f.prototype, "title", void 0), r([i({
|
|
109
|
+
type: String,
|
|
110
|
+
reflect: !0
|
|
111
|
+
})], f.prototype, "skin", void 0), r([i({
|
|
112
|
+
type: Boolean,
|
|
113
|
+
reflect: !0
|
|
114
|
+
})], f.prototype, "compact", void 0), r([i({
|
|
115
|
+
type: Boolean,
|
|
116
|
+
reflect: !0
|
|
117
|
+
})], f.prototype, "isOpen", void 0), r([i({
|
|
118
|
+
type: String,
|
|
119
|
+
reflect: !0
|
|
120
|
+
})], f.prototype, "name", void 0);
|
|
121
|
+
try {
|
|
122
|
+
t("pkt-accordion-item")(f);
|
|
123
|
+
} catch {
|
|
124
|
+
console.warn("Forsøker å definere <pkt-accordion-item>, men den er allerede definert");
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/components/accordion/index.ts
|
|
128
|
+
var p = d;
|
|
129
|
+
//#endregion
|
|
130
|
+
export { f as n, d as r, p as t };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),n=require(`./element-with-slot-CWoTGA1B.cjs`),r=require(`./classutils-z8YsPlOf.cjs`);require(`./icon-Dr8sfT2X.cjs`),require(`./button-D-TOBaJB.cjs`);var i={name:`pkt-alert`,react:`PktAlert`,"css-class":`pkt-alert`,"dark-mode":!0,isElement:!0,isPureReact:!0,events:{onClose:{description:`React: Klikk-event for 'Lukk'-knappen`},close:{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:[`info`,`success`,`warning`,`error`],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:[`off`,`polite`,`assertive`],default:`polite`,category:`accessibility`},compact:{name:`Kompakt`,description:`Gjør meldingen mindre`,type:`boolean`,category:`ui`,default:!1},closeAlert:{name:`Vis 'Lukk'-knapp`,description:`Viser 'Lukk'-knappen`,type:`boolean`,default:!1,category:`ui`}},slots:{default:{description:`Innholdet i meldingen`}}},a=class extends n.t{constructor(){super(),this.compact=i.props.compact.default,this.title=``,this.skin=i.props.skin.default,this.ariaLive=i.props.ariaLive.default,this.ariaLiveAttr=null,this.closeAlert=i.props.closeAlert.default,this.date=null,this.role=`status`,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!0,composed:!0}))},this._isClosed=!1}connectedCallback(){super.connectedCallback(),this.ariaLiveAttr=this.getAttribute(`aria-live`)||this.ariaLive}attributeChangedCallback(e,t,n){e===`ariaLive`&&(this.ariaLiveAttr=n),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`ariaLive`)&&(this.ariaLiveAttr=this.ariaLive),e.has(`_isClosed`)&&r.t(this,`pkt-hide`,this._isClosed)}render(){let 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 e.d`
|
|
2
|
+
<div class=${t.t(r)} aria-live=${this.ariaLiveAttr}>
|
|
3
|
+
<div class=${t.t(i)}>
|
|
4
|
+
<pkt-icon
|
|
5
|
+
class="pkt-alert__icon"
|
|
6
|
+
aria-hidden="true"
|
|
7
|
+
name=${this.skin===`info`?`alert-information`:`alert-${this.skin}`}
|
|
8
|
+
></pkt-icon>
|
|
9
|
+
|
|
10
|
+
${this.closeAlert?e.d`
|
|
11
|
+
<div class="pkt-alert__close">
|
|
12
|
+
<pkt-button
|
|
13
|
+
tabindex="0"
|
|
14
|
+
aria-label="close"
|
|
15
|
+
size=${this.compact?`small`:`medium`}
|
|
16
|
+
type="button"
|
|
17
|
+
skin="tertiary"
|
|
18
|
+
iconName="close"
|
|
19
|
+
variant="icon-only"
|
|
20
|
+
@click=${this.close}
|
|
21
|
+
>
|
|
22
|
+
<span class="sr-only">Lukk</span>
|
|
23
|
+
</pkt-button>
|
|
24
|
+
</div>
|
|
25
|
+
`:e.l}
|
|
26
|
+
${this.title?e.d`<div class="pkt-alert__title">${this.title}</div>`:e.l}
|
|
27
|
+
|
|
28
|
+
<div class="pkt-alert__text">${n.n(this)}</div>
|
|
29
|
+
|
|
30
|
+
${this.date?e.d`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:e.l}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
`}};e.r([e.s({type:Boolean,reflect:!1})],a.prototype,`compact`,void 0),e.r([e.s({type:String,reflect:!0})],a.prototype,`title`,void 0),e.r([e.s({type:String,reflect:!0})],a.prototype,`skin`,void 0),e.r([e.s({type:String})],a.prototype,`ariaLive`,void 0),e.r([e.s({type:String,reflect:!0,attribute:`aria-live`})],a.prototype,`ariaLiveAttr`,void 0),e.r([e.s({type:Boolean,reflect:!0})],a.prototype,`closeAlert`,void 0),e.r([e.s({type:String,reflect:!0})],a.prototype,`date`,void 0),e.r([e.s({type:String,reflect:!0})],a.prototype,`role`,void 0),e.r([e.o()],a.prototype,`_isClosed`,void 0);try{e.c(`pkt-alert`)(a)}catch{console.warn(`Forsøker å definere <pkt-alert>, 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}});
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { c as e, d as t, l as n, o as r, r as i, s as a } from "./element-cZ85T_aa.js";
|
|
2
|
+
import { t as o } from "./class-map-C8HuhNzZ.js";
|
|
3
|
+
import { n as s, t as c } from "./element-with-slot-4J2o3SeU.js";
|
|
4
|
+
import { t as l } from "./classutils-DEL164Ur.js";
|
|
5
|
+
import "./icon-Co72KtgF.js";
|
|
6
|
+
import "./button-BIpd1xJh.js";
|
|
7
|
+
var u = {
|
|
8
|
+
name: "pkt-alert",
|
|
9
|
+
react: "PktAlert",
|
|
10
|
+
"css-class": "pkt-alert",
|
|
11
|
+
"dark-mode": !0,
|
|
12
|
+
isElement: !0,
|
|
13
|
+
isPureReact: !0,
|
|
14
|
+
events: {
|
|
15
|
+
onClose: { description: "React: Klikk-event for 'Lukk'-knappen" },
|
|
16
|
+
close: { description: "Vue: Klikk-event for 'Lukk'-knappen" }
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
title: {
|
|
20
|
+
name: "Tittel",
|
|
21
|
+
description: "Tittelen som vises øverst i på meldingen",
|
|
22
|
+
type: "string",
|
|
23
|
+
category: "contents"
|
|
24
|
+
},
|
|
25
|
+
skin: {
|
|
26
|
+
name: "Utseende",
|
|
27
|
+
description: "Hvordan type melding er dette?",
|
|
28
|
+
type: [
|
|
29
|
+
"info",
|
|
30
|
+
"success",
|
|
31
|
+
"warning",
|
|
32
|
+
"error"
|
|
33
|
+
],
|
|
34
|
+
default: "info",
|
|
35
|
+
category: "ui"
|
|
36
|
+
},
|
|
37
|
+
date: {
|
|
38
|
+
name: "Sist oppdatert",
|
|
39
|
+
description: "Dato som vises nederst i på meldingen",
|
|
40
|
+
type: "string",
|
|
41
|
+
category: "contents"
|
|
42
|
+
},
|
|
43
|
+
ariaLive: {
|
|
44
|
+
name: "aria-live",
|
|
45
|
+
description: "Hvordan skal skjermleseren lese opp meldingen?",
|
|
46
|
+
type: [
|
|
47
|
+
"off",
|
|
48
|
+
"polite",
|
|
49
|
+
"assertive"
|
|
50
|
+
],
|
|
51
|
+
default: "polite",
|
|
52
|
+
category: "accessibility"
|
|
53
|
+
},
|
|
54
|
+
compact: {
|
|
55
|
+
name: "Kompakt",
|
|
56
|
+
description: "Gjør meldingen mindre",
|
|
57
|
+
type: "boolean",
|
|
58
|
+
category: "ui",
|
|
59
|
+
default: !1
|
|
60
|
+
},
|
|
61
|
+
closeAlert: {
|
|
62
|
+
name: "Vis 'Lukk'-knapp",
|
|
63
|
+
description: "Viser 'Lukk'-knappen",
|
|
64
|
+
type: "boolean",
|
|
65
|
+
default: !1,
|
|
66
|
+
category: "ui"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
slots: { default: { description: "Innholdet i meldingen" } }
|
|
70
|
+
}, d = class extends c {
|
|
71
|
+
constructor() {
|
|
72
|
+
super(), this.compact = u.props.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._isClosed = !1, this.close = (e) => {
|
|
73
|
+
this._isClosed = !0, this.dispatchEvent(new CustomEvent("close", {
|
|
74
|
+
detail: { origin: e },
|
|
75
|
+
bubbles: !0,
|
|
76
|
+
composed: !0
|
|
77
|
+
})), this.dispatchEvent(new CustomEvent("on-close", {
|
|
78
|
+
detail: { origin: e },
|
|
79
|
+
bubbles: !0,
|
|
80
|
+
composed: !0
|
|
81
|
+
}));
|
|
82
|
+
}, this._isClosed = !1;
|
|
83
|
+
}
|
|
84
|
+
connectedCallback() {
|
|
85
|
+
super.connectedCallback(), this.ariaLiveAttr = this.getAttribute("aria-live") || this.ariaLive;
|
|
86
|
+
}
|
|
87
|
+
attributeChangedCallback(e, t, n) {
|
|
88
|
+
e === "ariaLive" && (this.ariaLiveAttr = n), super.attributeChangedCallback(e, t, n);
|
|
89
|
+
}
|
|
90
|
+
updated(e) {
|
|
91
|
+
super.updated(e), e.has("ariaLive") && (this.ariaLiveAttr = this.ariaLive), e.has("_isClosed") && l(this, "pkt-hide", this._isClosed);
|
|
92
|
+
}
|
|
93
|
+
render() {
|
|
94
|
+
let e = {
|
|
95
|
+
"pkt-alert": !0,
|
|
96
|
+
"pkt-alert--compact": this.compact,
|
|
97
|
+
[`pkt-alert--${this.skin}`]: this.skin,
|
|
98
|
+
"pkt-hide": this._isClosed
|
|
99
|
+
}, r = {
|
|
100
|
+
"pkt-alert__grid": !0,
|
|
101
|
+
"pkt-alert__noTitle": !this.title,
|
|
102
|
+
"pkt-alert__noDate": !this.date
|
|
103
|
+
};
|
|
104
|
+
return t`
|
|
105
|
+
<div class=${o(e)} aria-live=${this.ariaLiveAttr}>
|
|
106
|
+
<div class=${o(r)}>
|
|
107
|
+
<pkt-icon
|
|
108
|
+
class="pkt-alert__icon"
|
|
109
|
+
aria-hidden="true"
|
|
110
|
+
name=${this.skin === "info" ? "alert-information" : `alert-${this.skin}`}
|
|
111
|
+
></pkt-icon>
|
|
112
|
+
|
|
113
|
+
${this.closeAlert ? t`
|
|
114
|
+
<div class="pkt-alert__close">
|
|
115
|
+
<pkt-button
|
|
116
|
+
tabindex="0"
|
|
117
|
+
aria-label="close"
|
|
118
|
+
size=${this.compact ? "small" : "medium"}
|
|
119
|
+
type="button"
|
|
120
|
+
skin="tertiary"
|
|
121
|
+
iconName="close"
|
|
122
|
+
variant="icon-only"
|
|
123
|
+
@click=${this.close}
|
|
124
|
+
>
|
|
125
|
+
<span class="sr-only">Lukk</span>
|
|
126
|
+
</pkt-button>
|
|
127
|
+
</div>
|
|
128
|
+
` : n}
|
|
129
|
+
${this.title ? t`<div class="pkt-alert__title">${this.title}</div>` : n}
|
|
130
|
+
|
|
131
|
+
<div class="pkt-alert__text">${s(this)}</div>
|
|
132
|
+
|
|
133
|
+
${this.date ? t`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>` : n}
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
`;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
i([a({
|
|
140
|
+
type: Boolean,
|
|
141
|
+
reflect: !1
|
|
142
|
+
})], d.prototype, "compact", void 0), i([a({
|
|
143
|
+
type: String,
|
|
144
|
+
reflect: !0
|
|
145
|
+
})], d.prototype, "title", void 0), i([a({
|
|
146
|
+
type: String,
|
|
147
|
+
reflect: !0
|
|
148
|
+
})], d.prototype, "skin", void 0), i([a({ type: String })], d.prototype, "ariaLive", void 0), i([a({
|
|
149
|
+
type: String,
|
|
150
|
+
reflect: !0,
|
|
151
|
+
attribute: "aria-live"
|
|
152
|
+
})], d.prototype, "ariaLiveAttr", void 0), i([a({
|
|
153
|
+
type: Boolean,
|
|
154
|
+
reflect: !0
|
|
155
|
+
})], d.prototype, "closeAlert", void 0), i([a({
|
|
156
|
+
type: String,
|
|
157
|
+
reflect: !0
|
|
158
|
+
})], d.prototype, "date", void 0), i([a({
|
|
159
|
+
type: String,
|
|
160
|
+
reflect: !0
|
|
161
|
+
})], d.prototype, "role", void 0), i([r()], d.prototype, "_isClosed", void 0);
|
|
162
|
+
try {
|
|
163
|
+
e("pkt-alert")(d);
|
|
164
|
+
} catch {
|
|
165
|
+
console.warn("Forsøker å definere <pkt-alert>, men den er allerede definert");
|
|
166
|
+
}
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/components/alert/index.ts
|
|
169
|
+
var f = d;
|
|
170
|
+
//#endregion
|
|
171
|
+
export { d as n, f as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./directive-CJ2giQBZ.cjs`),t=require(`./directive-helpers-D1QSxY17.cjs`);var n=(e,t)=>{let r=e._$AN;if(r===void 0)return!1;for(let e of r)e._$AO?.(t,!1),n(e,t);return!0},r=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},i=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),s(t)}};function a(e){this._$AN===void 0?this._$AM=e:(r(this),this._$AM=e,i(this))}function o(e,t=!1,i=0){let a=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(a))for(let e=i;e<a.length;e++)n(a[e],!1),r(a[e]);else a!=null&&(n(a,!1),r(a));else n(this,e)}var s=t=>{t.type==e.r.CHILD&&(t._$AP??=o,t._$AQ??=a)},c=class extends e.n{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),i(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(n(this,e),r(this))}setValue(e){if(t.i(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { n as e, r as t } from "./directive-3THFsVew.js";
|
|
2
|
+
import { i as n } from "./directive-helpers-Dkv2gKgs.js";
|
|
3
|
+
//#region ../../node_modules/lit-html/async-directive.js
|
|
4
|
+
var r = (e, t) => {
|
|
5
|
+
let n = e._$AN;
|
|
6
|
+
if (n === void 0) return !1;
|
|
7
|
+
for (let e of n) e._$AO?.(t, !1), r(e, t);
|
|
8
|
+
return !0;
|
|
9
|
+
}, i = (e) => {
|
|
10
|
+
let t, n;
|
|
11
|
+
do {
|
|
12
|
+
if ((t = e._$AM) === void 0) break;
|
|
13
|
+
n = t._$AN, n.delete(e), e = t;
|
|
14
|
+
} while (n?.size === 0);
|
|
15
|
+
}, a = (e) => {
|
|
16
|
+
for (let t; t = e._$AM; e = t) {
|
|
17
|
+
let n = t._$AN;
|
|
18
|
+
if (n === void 0) t._$AN = n = /* @__PURE__ */ new Set();
|
|
19
|
+
else if (n.has(e)) break;
|
|
20
|
+
n.add(e), c(t);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
function o(e) {
|
|
24
|
+
this._$AN === void 0 ? this._$AM = e : (i(this), this._$AM = e, a(this));
|
|
25
|
+
}
|
|
26
|
+
function s(e, t = !1, n = 0) {
|
|
27
|
+
let a = this._$AH, o = this._$AN;
|
|
28
|
+
if (o !== void 0 && o.size !== 0) if (t) if (Array.isArray(a)) for (let e = n; e < a.length; e++) r(a[e], !1), i(a[e]);
|
|
29
|
+
else a != null && (r(a, !1), i(a));
|
|
30
|
+
else r(this, e);
|
|
31
|
+
}
|
|
32
|
+
var c = (e) => {
|
|
33
|
+
e.type == t.CHILD && (e._$AP ??= s, e._$AQ ??= o);
|
|
34
|
+
}, l = class extends e {
|
|
35
|
+
constructor() {
|
|
36
|
+
super(...arguments), this._$AN = void 0;
|
|
37
|
+
}
|
|
38
|
+
_$AT(e, t, n) {
|
|
39
|
+
super._$AT(e, t, n), a(this), this.isConnected = e._$AU;
|
|
40
|
+
}
|
|
41
|
+
_$AO(e, t = !0) {
|
|
42
|
+
e !== this.isConnected && (this.isConnected = e, e ? this.reconnected?.() : this.disconnected?.()), t && (r(this, e), i(this));
|
|
43
|
+
}
|
|
44
|
+
setValue(e) {
|
|
45
|
+
if (n(this._$Ct)) this._$Ct._$AI(e, this);
|
|
46
|
+
else {
|
|
47
|
+
let t = [...this._$Ct._$AH];
|
|
48
|
+
t[this._$Ci] = e, this._$Ct._$AI(t, this, 0);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
disconnected() {}
|
|
52
|
+
reconnected() {}
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
export { l as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const e=require(`./element-DjtxO-1r.cjs`);require(`./icon-Dr8sfT2X.cjs`);const t=require(`./if-defined-XKOD_t_V.cjs`);var n=class extends e.t{constructor(...e){super(...e),this.href=``,this.text=`Forsiden`,this.ariaLabel=``}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.d`<nav
|
|
2
|
+
class="pkt-back-link"
|
|
3
|
+
aria-label=${this.ariaLabel||`Gå tilbake til forrige side`}
|
|
4
|
+
>
|
|
5
|
+
<a href=${t.t(this.href||`/`)} class="pkt-link pkt-link--icon-left"
|
|
6
|
+
><pkt-icon
|
|
7
|
+
class="pkt-back-link__icon pkt-icon pkt-link__icon"
|
|
8
|
+
name="chevron-thin-left"
|
|
9
|
+
aria-hidden="true"
|
|
10
|
+
></pkt-icon
|
|
11
|
+
><span class="pkt-back-link__text">${this.text}</span></a
|
|
12
|
+
>
|
|
13
|
+
</nav>`}};e.r([e.s({type:String})],n.prototype,`href`,void 0),e.r([e.s({type:String})],n.prototype,`text`,void 0),e.r([e.s({type:String})],n.prototype,`ariaLabel`,void 0);try{e.c(`pkt-backlink`)(n)}catch{console.warn(`Forsøker å definere <pkt-backlink>, men den er allerede definert`)}var r=n;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { c as e, d as t, r as n, s as r, t as i } from "./element-cZ85T_aa.js";
|
|
2
|
+
import "./icon-Co72KtgF.js";
|
|
3
|
+
import { t as a } from "./if-defined-Cjj8qN-Z.js";
|
|
4
|
+
//#region src/components/backlink/backlink.ts
|
|
5
|
+
var o = class extends i {
|
|
6
|
+
constructor(...e) {
|
|
7
|
+
super(...e), this.href = "", this.text = "Forsiden", this.ariaLabel = "";
|
|
8
|
+
}
|
|
9
|
+
attributeChangedCallback(e, t, n) {
|
|
10
|
+
e === "arialabel" && this.removeAttribute("arialabel"), e === "href" && this.removeAttribute("href"), e === "text" && this.removeAttribute("text"), super.attributeChangedCallback(e, t, n);
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return t`<nav
|
|
14
|
+
class="pkt-back-link"
|
|
15
|
+
aria-label=${this.ariaLabel || "Gå tilbake til forrige side"}
|
|
16
|
+
>
|
|
17
|
+
<a href=${a(this.href || "/")} class="pkt-link pkt-link--icon-left"
|
|
18
|
+
><pkt-icon
|
|
19
|
+
class="pkt-back-link__icon pkt-icon pkt-link__icon"
|
|
20
|
+
name="chevron-thin-left"
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
></pkt-icon
|
|
23
|
+
><span class="pkt-back-link__text">${this.text}</span></a
|
|
24
|
+
>
|
|
25
|
+
</nav>`;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
n([r({ type: String })], o.prototype, "href", void 0), n([r({ type: String })], o.prototype, "text", void 0), n([r({ type: String })], o.prototype, "ariaLabel", void 0);
|
|
29
|
+
try {
|
|
30
|
+
e("pkt-backlink")(o);
|
|
31
|
+
} catch {
|
|
32
|
+
console.warn("Forsøker å definere <pkt-backlink>, men den er allerede definert");
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/components/backlink/index.ts
|
|
36
|
+
var s = o;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { o as n, s as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region ../../shared-types/booleanish.ts
|
|
2
|
+
var e = {
|
|
3
|
+
fromAttribute(e) {
|
|
4
|
+
return e == null ? !1 : e === "" || e === "true" || e === !0 ? !0 : e === "false" || e === !1 ? !1 : !!e;
|
|
5
|
+
},
|
|
6
|
+
toAttribute(e) {
|
|
7
|
+
return e ? "true" : "false";
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { e as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={fromAttribute(e){return e==null?!1:e===``||e===`true`||e===!0?!0:e===`false`||e===!1?!1:!!e},toAttribute(e){return e?`true`:`false`}};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const e=require(`./element-DjtxO-1r.cjs`);require(`./icon-Dr8sfT2X.cjs`);var t=class extends e.t{constructor(...e){super(...e),this.breadcrumbs=[]}handleLinkClick(e,t,n){let r=new CustomEvent(`navigate`,{detail:{item:t,index:n,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}render(){if(!this.breadcrumbs||this.breadcrumbs.length===0)return e.l;let t=this.breadcrumbs[this.breadcrumbs.length-2];return e.d`
|
|
2
|
+
<nav class="pkt-breadcrumbs" aria-label="brødsmulemeny">
|
|
3
|
+
<ol class="pkt-breadcrumbs__list pkt-breadcrumbs--desktop">
|
|
4
|
+
${this.breadcrumbs.map((t,n)=>n===this.breadcrumbs.length-1?e.d`
|
|
5
|
+
<li class="pkt-breadcrumbs__item">
|
|
6
|
+
<span class="pkt-breadcrumbs__label" aria-current="true">
|
|
7
|
+
<span class="pkt-breadcrumbs__text">${t.text}</span>
|
|
8
|
+
</span>
|
|
9
|
+
</li>
|
|
10
|
+
`:e.d`
|
|
11
|
+
<li class="pkt-breadcrumbs__item">
|
|
12
|
+
<a
|
|
13
|
+
class="pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link"
|
|
14
|
+
href=${t.href}
|
|
15
|
+
@click=${e=>this.handleLinkClick(e,t,n)}
|
|
16
|
+
>
|
|
17
|
+
<pkt-icon
|
|
18
|
+
class="pkt-icon pkt-breadcrumbs__icon pkt-link__icon"
|
|
19
|
+
name="chevron-thin-right"
|
|
20
|
+
aria-hidden="true"
|
|
21
|
+
></pkt-icon>
|
|
22
|
+
<span class="pkt-breadcrumbs__text">${t.text}</span>
|
|
23
|
+
</a>
|
|
24
|
+
</li>
|
|
25
|
+
`)}
|
|
26
|
+
</ol>
|
|
27
|
+
|
|
28
|
+
${t?e.d`
|
|
29
|
+
<a
|
|
30
|
+
class="pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile"
|
|
31
|
+
href=${t.href}
|
|
32
|
+
@click=${e=>this.handleLinkClick(e,t,this.breadcrumbs.length-2)}
|
|
33
|
+
>
|
|
34
|
+
<pkt-icon
|
|
35
|
+
class="pkt-back-link__icon pkt-icon pkt-link__icon"
|
|
36
|
+
name="chevron-thin-left"
|
|
37
|
+
aria-hidden="true"
|
|
38
|
+
></pkt-icon>
|
|
39
|
+
<span class="pkt-breadcrumbs__text">${t.text}</span>
|
|
40
|
+
</a>
|
|
41
|
+
`:e.l}
|
|
42
|
+
</nav>
|
|
43
|
+
`}};e.r([e.s({type:Array})],t.prototype,`breadcrumbs`,void 0);try{e.c(`pkt-breadcrumbs`)(t)}catch{console.warn(`Forsøker å definere <pkt-breadcrumbs>, men den er allerede definert`)}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { c as e, d as t, l as n, r, s as i, t as a } from "./element-cZ85T_aa.js";
|
|
2
|
+
import "./icon-Co72KtgF.js";
|
|
3
|
+
//#region src/components/breadcrumbs/breadcrumbs.ts
|
|
4
|
+
var o = class extends a {
|
|
5
|
+
constructor(...e) {
|
|
6
|
+
super(...e), this.breadcrumbs = [];
|
|
7
|
+
}
|
|
8
|
+
handleLinkClick(e, t, n) {
|
|
9
|
+
let r = new CustomEvent("navigate", {
|
|
10
|
+
detail: {
|
|
11
|
+
item: t,
|
|
12
|
+
index: n,
|
|
13
|
+
originalEvent: e
|
|
14
|
+
},
|
|
15
|
+
bubbles: !0,
|
|
16
|
+
composed: !0,
|
|
17
|
+
cancelable: !0
|
|
18
|
+
});
|
|
19
|
+
this.dispatchEvent(r) || e.preventDefault();
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
if (!this.breadcrumbs || this.breadcrumbs.length === 0) return n;
|
|
23
|
+
let e = this.breadcrumbs[this.breadcrumbs.length - 2];
|
|
24
|
+
return t`
|
|
25
|
+
<nav class="pkt-breadcrumbs" aria-label="brødsmulemeny">
|
|
26
|
+
<ol class="pkt-breadcrumbs__list pkt-breadcrumbs--desktop">
|
|
27
|
+
${this.breadcrumbs.map((e, n) => n === this.breadcrumbs.length - 1 ? t`
|
|
28
|
+
<li class="pkt-breadcrumbs__item">
|
|
29
|
+
<span class="pkt-breadcrumbs__label" aria-current="true">
|
|
30
|
+
<span class="pkt-breadcrumbs__text">${e.text}</span>
|
|
31
|
+
</span>
|
|
32
|
+
</li>
|
|
33
|
+
` : t`
|
|
34
|
+
<li class="pkt-breadcrumbs__item">
|
|
35
|
+
<a
|
|
36
|
+
class="pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link"
|
|
37
|
+
href=${e.href}
|
|
38
|
+
@click=${(t) => this.handleLinkClick(t, e, n)}
|
|
39
|
+
>
|
|
40
|
+
<pkt-icon
|
|
41
|
+
class="pkt-icon pkt-breadcrumbs__icon pkt-link__icon"
|
|
42
|
+
name="chevron-thin-right"
|
|
43
|
+
aria-hidden="true"
|
|
44
|
+
></pkt-icon>
|
|
45
|
+
<span class="pkt-breadcrumbs__text">${e.text}</span>
|
|
46
|
+
</a>
|
|
47
|
+
</li>
|
|
48
|
+
`)}
|
|
49
|
+
</ol>
|
|
50
|
+
|
|
51
|
+
${e ? t`
|
|
52
|
+
<a
|
|
53
|
+
class="pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile"
|
|
54
|
+
href=${e.href}
|
|
55
|
+
@click=${(t) => this.handleLinkClick(t, e, this.breadcrumbs.length - 2)}
|
|
56
|
+
>
|
|
57
|
+
<pkt-icon
|
|
58
|
+
class="pkt-back-link__icon pkt-icon pkt-link__icon"
|
|
59
|
+
name="chevron-thin-left"
|
|
60
|
+
aria-hidden="true"
|
|
61
|
+
></pkt-icon>
|
|
62
|
+
<span class="pkt-breadcrumbs__text">${e.text}</span>
|
|
63
|
+
</a>
|
|
64
|
+
` : n}
|
|
65
|
+
</nav>
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
r([i({ type: Array })], o.prototype, "breadcrumbs", void 0);
|
|
70
|
+
try {
|
|
71
|
+
e("pkt-breadcrumbs")(o);
|
|
72
|
+
} catch {
|
|
73
|
+
console.warn("Forsøker å definere <pkt-breadcrumbs>, men den er allerede definert");
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { o as t };
|