@oslokommune/punkt-elements 12.18.0 → 12.18.2
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/dist/alert-BbVWu2lm.cjs +27 -0
- package/dist/alert-Dh6A96vo.js +159 -0
- package/dist/{index-D2jSRMrn.js → calendar-BUqcNvfI.js} +41 -29
- package/dist/calendar-QSulz7im.cjs +108 -0
- package/dist/card-B0GPdG5M.cjs +23 -0
- package/dist/card-kWt0BA2a.js +170 -0
- package/dist/{class-map-a5HUzP83.cjs → class-map-Boa7BqCc.cjs} +2 -2
- package/dist/{class-map-CBvUV2N3.js → class-map-hz16xq5a.js} +9 -10
- package/dist/datepicker-BhavwiBZ.js +659 -0
- package/dist/datepicker-vX74tb3R.cjs +154 -0
- package/dist/helptext--4FLdAWi.js +194 -0
- package/dist/helptext-iZEgxz2U.cjs +23 -0
- package/dist/icon-CdMQ6zBT.cjs +250 -0
- package/dist/{index-CFDwiDTU.js → icon-wUXeHiBk.js} +7371 -7559
- package/dist/if-defined-DEDlGbAc.cjs +5 -0
- package/dist/if-defined-ZFE4ti2t.js +10 -0
- package/dist/index.d.ts +49 -51
- package/dist/input-element-BQTCZtNQ.js +185 -0
- package/dist/input-element-DNklGY_O.cjs +1 -0
- package/dist/{input-wrapper-DVXNuxVu.js → input-wrapper-BTQk3W8T.js} +10 -11
- package/dist/input-wrapper-D-PNRJB_.cjs +46 -0
- package/dist/link-BpqavGSD.cjs +8 -0
- package/dist/link-Bx9nVgZi.js +108 -0
- package/dist/linkcard-CUrbzjLK.js +53 -0
- package/dist/linkcard-DSu3A4Yx.cjs +13 -0
- package/dist/messagebox-C1aWoQbu.cjs +12 -0
- package/dist/messagebox-LpiVQIoM.js +107 -0
- package/dist/modal-Avai5eVz.cjs +30 -0
- package/dist/{modal-lQfiTbGh.js → modal-Co1YFmHi.js} +7 -8
- package/dist/pkt-alert.cjs +1 -27
- package/dist/pkt-alert.js +4 -158
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +4 -7
- package/dist/pkt-card.cjs +1 -23
- package/dist/pkt-card.js +4 -169
- package/dist/pkt-datepicker.cjs +1 -154
- package/dist/pkt-datepicker.js +4 -657
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +4 -4
- package/dist/pkt-index.cjs +29 -1
- package/dist/pkt-index.js +127 -32
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -8
- package/dist/pkt-link.js +4 -108
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -12
- package/dist/pkt-messagebox.js +4 -106
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -2
- package/dist/pkt-tag.cjs +1 -17
- package/dist/pkt-tag.js +4 -149
- 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/{progressbar-1PEs_SMc.js → progressbar-BS_oawSB.js} +42 -47
- package/dist/{progressbar-BlzTFI9U.cjs → progressbar-CuXkbAhJ.cjs} +7 -11
- package/dist/ref-DCOsLZQg.cjs +13 -0
- package/dist/{ref-Dzme4zb6.js → ref-DuFGTLVX.js} +26 -27
- package/dist/state-BfyXV7EL.js +12 -0
- package/dist/state-SKYD8kRO.cjs +5 -0
- package/dist/stringutils-CkVRq4jP.cjs +1 -0
- package/dist/stringutils-DJjRa8dG.js +7 -0
- package/dist/tag-CGy2mSLE.cjs +17 -0
- package/dist/tag-DGFgUF3l.js +150 -0
- package/dist/textarea-BFWHQHLs.cjs +48 -0
- package/dist/{textarea-BXzQA_ub.js → textarea-BYtGXst8.js} +29 -29
- package/dist/{textinput-52G3CfwA.cjs → textinput-33wZwZ4O.cjs} +2 -2
- package/dist/{textinput-CTNWiIaP.js → textinput-IgHewJDJ.js} +23 -23
- package/package.json +2 -2
- package/src/components/alert/alert.ts +115 -0
- package/src/components/alert/index.ts +4 -113
- package/src/components/calendar/calendar.ts +711 -0
- package/src/components/calendar/index.ts +3 -711
- package/src/components/card/card.ts +78 -0
- package/src/components/card/index.ts +4 -77
- package/src/components/datepicker/datepicker.ts +619 -0
- package/src/components/datepicker/index.ts +3 -618
- package/src/components/helptext/helptext.ts +2 -2
- package/src/components/icon/icon.ts +99 -0
- package/src/components/icon/index.ts +3 -98
- package/src/components/index.ts +21 -17
- package/src/components/input-wrapper/input-wrapper.ts +2 -2
- package/src/components/link/index.ts +3 -56
- package/src/components/link/link.ts +57 -0
- package/src/components/linkcard/index.ts +1 -1
- package/src/components/linkcard/linkcard.ts +5 -6
- package/src/components/messagebox/index.ts +4 -69
- package/src/components/messagebox/messagebox.ts +69 -0
- package/src/components/modal/index.ts +0 -1
- package/src/components/modal/modal.ts +5 -7
- package/src/components/progressbar/progressbar.ts +2 -2
- package/src/components/tag/index.ts +4 -109
- package/src/components/tag/tag.ts +118 -0
- package/src/components/textarea/textarea.ts +5 -4
- package/src/components/textinput/textinput.ts +3 -3
- package/dist/component-template.d.ts +0 -8
- package/dist/converters-DNCwIFwr.js +0 -17
- package/dist/converters-DhM11VlY.cjs +0 -1
- package/dist/custom-element-B-TlBwRu.cjs +0 -9
- package/dist/custom-element-CWfU4dcr.js +0 -38
- package/dist/element.d.ts +0 -8
- package/dist/helptext-DBolvFI4.js +0 -72
- package/dist/helptext-_fMLOOCL.cjs +0 -23
- package/dist/index-CR7t1zY9.cjs +0 -238
- package/dist/index-CmTjXoAb.cjs +0 -9
- package/dist/index-RwtTBIhT.js +0 -88
- package/dist/index-tvpcg-ad.cjs +0 -108
- package/dist/input-wrapper-tJE-X4Ac.cjs +0 -46
- package/dist/linkcard-BHokvuVN.js +0 -55
- package/dist/linkcard-CUXMP6BH.cjs +0 -13
- package/dist/modal-CjsQgmmH.cjs +0 -30
- package/dist/pkt-component-template.cjs +0 -29
- package/dist/pkt-component-template.js +0 -100
- package/dist/pkt-element.cjs +0 -1
- package/dist/pkt-element.js +0 -5
- package/dist/ref-CA2-0S_W.cjs +0 -13
- package/dist/textarea-D_ud1Mpa.cjs +0 -48
- package/src/components/component-template/index.ts +0 -129
- package/src/components/element/index.ts +0 -353
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { e as g } from "./class-map-hz16xq5a.js";
|
|
2
|
+
import { o as h } from "./if-defined-ZFE4ti2t.js";
|
|
3
|
+
import { P as k, x as r, E as u, n as a, t as m } from "./icon-wUXeHiBk.js";
|
|
4
|
+
import { P as y } from "./pkt-slot-controller-RJvOnbF4.js";
|
|
5
|
+
import { e as f, n as b } from "./ref-DuFGTLVX.js";
|
|
6
|
+
import "./tag-DGFgUF3l.js";
|
|
7
|
+
const v = "pkt-card", $ = !0, _ = {
|
|
8
|
+
heading: {
|
|
9
|
+
type: "string",
|
|
10
|
+
name: "Heading",
|
|
11
|
+
description: "Tittel på kortet"
|
|
12
|
+
},
|
|
13
|
+
subheading: {
|
|
14
|
+
type: "string",
|
|
15
|
+
name: "Subheading",
|
|
16
|
+
description: "Undertittel på kortet"
|
|
17
|
+
},
|
|
18
|
+
tags: {
|
|
19
|
+
type: "array",
|
|
20
|
+
description: "Liste av tags på kortet. Tar inn en array med objekter med følgende stringproperties: skin, iconName, ariaLabel, text",
|
|
21
|
+
name: "Tags",
|
|
22
|
+
items: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
skin: {
|
|
26
|
+
type: [
|
|
27
|
+
"blue",
|
|
28
|
+
"green",
|
|
29
|
+
"red",
|
|
30
|
+
"yellow"
|
|
31
|
+
],
|
|
32
|
+
description: "Farge på tag"
|
|
33
|
+
},
|
|
34
|
+
iconName: {
|
|
35
|
+
type: "icon",
|
|
36
|
+
description: "Id på ikonet du ønsker å bruke til tag"
|
|
37
|
+
},
|
|
38
|
+
ariaLabel: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "Tekst for aria-label"
|
|
41
|
+
},
|
|
42
|
+
text: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "Tekst på tag",
|
|
45
|
+
required: !0
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
skin: {
|
|
51
|
+
type: [
|
|
52
|
+
"outlined",
|
|
53
|
+
"gray",
|
|
54
|
+
"blue",
|
|
55
|
+
"beige",
|
|
56
|
+
"green"
|
|
57
|
+
],
|
|
58
|
+
name: "Skin",
|
|
59
|
+
description: "Farge på kortet",
|
|
60
|
+
default: "outlined"
|
|
61
|
+
},
|
|
62
|
+
direction: {
|
|
63
|
+
type: [
|
|
64
|
+
"landscape",
|
|
65
|
+
"portrait"
|
|
66
|
+
],
|
|
67
|
+
name: "Direction",
|
|
68
|
+
description: "Retningen innholdet skal ligge i forhold til kortet",
|
|
69
|
+
default: "portrait"
|
|
70
|
+
},
|
|
71
|
+
image: {
|
|
72
|
+
type: "object",
|
|
73
|
+
name: "Bilde",
|
|
74
|
+
description: "Bilde på kortet. Tar inn et objekt av typen {src: string, alt: string}. src er stien til bildet, og alt er tekst for aria-label.",
|
|
75
|
+
properties: {
|
|
76
|
+
src: {
|
|
77
|
+
type: "string",
|
|
78
|
+
description: "Bilde på kortet",
|
|
79
|
+
required: !0
|
|
80
|
+
},
|
|
81
|
+
alt: {
|
|
82
|
+
type: "string",
|
|
83
|
+
description: "Tekst for aria-label",
|
|
84
|
+
required: !0
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}, S = {
|
|
89
|
+
default: {
|
|
90
|
+
description: "Innholdet i kortet"
|
|
91
|
+
}
|
|
92
|
+
}, c = {
|
|
93
|
+
name: v,
|
|
94
|
+
"css-class": "pkt-card",
|
|
95
|
+
isElement: $,
|
|
96
|
+
props: _,
|
|
97
|
+
slots: S
|
|
98
|
+
};
|
|
99
|
+
var x = Object.defineProperty, P = Object.getOwnPropertyDescriptor, s = (n, e, p, o) => {
|
|
100
|
+
for (var i = o > 1 ? void 0 : o ? P(e, p) : e, l = n.length - 1, d; l >= 0; l--)
|
|
101
|
+
(d = n[l]) && (i = (o ? d(e, p, i) : d(i)) || i);
|
|
102
|
+
return o && i && x(e, p, i), i;
|
|
103
|
+
};
|
|
104
|
+
let t = class extends k {
|
|
105
|
+
constructor() {
|
|
106
|
+
super(), this.defaultSlot = f(), this.skin = c.props.skin.default, this.direction = c.props.direction.default, this.image = {
|
|
107
|
+
src: "",
|
|
108
|
+
alt: ""
|
|
109
|
+
}, this.heading = "", this.subheading = "", this.tags = [], this.slotController = new y(this, this.defaultSlot);
|
|
110
|
+
}
|
|
111
|
+
connectedCallback() {
|
|
112
|
+
super.connectedCallback();
|
|
113
|
+
}
|
|
114
|
+
render() {
|
|
115
|
+
const n = {
|
|
116
|
+
"pkt-card": !0,
|
|
117
|
+
[`pkt-card--${this.skin}`]: this.skin,
|
|
118
|
+
[`pkt-card--${this.direction}`]: this.direction
|
|
119
|
+
};
|
|
120
|
+
return r`
|
|
121
|
+
<div class=${g(n)}>
|
|
122
|
+
${this.image.src && r`
|
|
123
|
+
<div class="pkt-card__image">
|
|
124
|
+
<img src=${this.image.src} alt=${this.image.alt || ""} />
|
|
125
|
+
</div>
|
|
126
|
+
`}
|
|
127
|
+
<div class="pkt-card__wrapper">
|
|
128
|
+
${this.tags.length > 0 ? r`
|
|
129
|
+
<div class="pkt-card__tags">
|
|
130
|
+
${this.tags.map(
|
|
131
|
+
(e) => r`
|
|
132
|
+
<pkt-tag textStyle="normal-text" size="medium" skin=${h(e.skin)}>
|
|
133
|
+
${e.text}
|
|
134
|
+
</pkt-tag>
|
|
135
|
+
`
|
|
136
|
+
)}
|
|
137
|
+
</div>
|
|
138
|
+
` : u}
|
|
139
|
+
${this.heading && r`<h3 class="pkt-txt-30-medium">${this.heading}</h3>`}
|
|
140
|
+
${this.subheading && r`<p class="pkt-txt-20-light">${this.subheading}</p>`}
|
|
141
|
+
${this.defaultSlot && r`<div class="pkt-card__content" ${b(this.defaultSlot)}></div>`}
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
`;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
s([
|
|
148
|
+
a({ type: String, reflect: !0 })
|
|
149
|
+
], t.prototype, "skin", 2);
|
|
150
|
+
s([
|
|
151
|
+
a({ type: String, reflect: !0 })
|
|
152
|
+
], t.prototype, "direction", 2);
|
|
153
|
+
s([
|
|
154
|
+
a({ type: Object, reflect: !0 })
|
|
155
|
+
], t.prototype, "image", 2);
|
|
156
|
+
s([
|
|
157
|
+
a({ type: String, reflect: !0 })
|
|
158
|
+
], t.prototype, "heading", 2);
|
|
159
|
+
s([
|
|
160
|
+
a({ type: String, reflect: !0 })
|
|
161
|
+
], t.prototype, "subheading", 2);
|
|
162
|
+
s([
|
|
163
|
+
a({ type: Array, reflect: !0 })
|
|
164
|
+
], t.prototype, "tags", 2);
|
|
165
|
+
t = s([
|
|
166
|
+
m("pkt-card")
|
|
167
|
+
], t);
|
|
168
|
+
export {
|
|
169
|
+
t as P
|
|
170
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=require("./icon-CdMQ6zBT.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2018 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
5
|
+
*/const a=n.e(class extends n.i{constructor(s){var e;if(super(s),s.type!==n.t$1.ATTRIBUTE||s.name!=="class"||((e=s.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(e=>s[e]).join(" ")+" "}update(s,[e]){var i,o;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(t=>t!=="")));for(const t in e)e[t]&&!((i=this.nt)!=null&&i.has(t))&&this.st.add(t);return this.render(e)}const r=s.element.classList;for(const t of this.st)t in e||(r.remove(t),this.st.delete(t));for(const t in e){const h=!!e[t];h===this.st.has(t)||(o=this.nt)!=null&&o.has(t)||(h?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return n.T}});exports.e=a;
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { e as h, i as d, a as c } from "./custom-element-CWfU4dcr.js";
|
|
1
|
+
import { e as a, i as h, b as d, T as c } from "./icon-wUXeHiBk.js";
|
|
3
2
|
/**
|
|
4
3
|
* @license
|
|
5
4
|
* Copyright 2018 Google LLC
|
|
6
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
const u =
|
|
7
|
+
const u = a(class extends h {
|
|
9
8
|
constructor(s) {
|
|
10
9
|
var e;
|
|
11
|
-
if (super(s), s.type !==
|
|
10
|
+
if (super(s), s.type !== d.ATTRIBUTE || s.name !== "class" || ((e = s.strings) == null ? void 0 : e.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
12
11
|
}
|
|
13
12
|
render(s) {
|
|
14
13
|
return " " + Object.keys(s).filter((e) => s[e]).join(" ") + " ";
|
|
15
14
|
}
|
|
16
15
|
update(s, [e]) {
|
|
17
|
-
var
|
|
16
|
+
var r, i;
|
|
18
17
|
if (this.st === void 0) {
|
|
19
18
|
this.st = /* @__PURE__ */ new Set(), s.strings !== void 0 && (this.nt = new Set(s.strings.join(" ").split(/\s/).filter((t) => t !== "")));
|
|
20
|
-
for (const t in e) e[t] && !((
|
|
19
|
+
for (const t in e) e[t] && !((r = this.nt) != null && r.has(t)) && this.st.add(t);
|
|
21
20
|
return this.render(e);
|
|
22
21
|
}
|
|
23
|
-
const
|
|
24
|
-
for (const t of this.st) t in e || (
|
|
22
|
+
const n = s.element.classList;
|
|
23
|
+
for (const t of this.st) t in e || (n.remove(t), this.st.delete(t));
|
|
25
24
|
for (const t in e) {
|
|
26
25
|
const o = !!e[t];
|
|
27
|
-
o === this.st.has(t) || (i = this.nt) != null && i.has(t) || (o ? (
|
|
26
|
+
o === this.st.has(t) || (i = this.nt) != null && i.has(t) || (o ? (n.add(t), this.st.add(t)) : (n.remove(t), this.st.delete(t)));
|
|
28
27
|
}
|
|
29
|
-
return
|
|
28
|
+
return c;
|
|
30
29
|
}
|
|
31
30
|
});
|
|
32
31
|
export {
|