@oslokommune/punkt-elements 12.17.2 → 12.18.1
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-BHepKxof.cjs +154 -0
- package/dist/datepicker-iNCYioZ9.js +659 -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 +96 -51
- package/dist/input-element-D1Vls6A5.js +184 -0
- package/dist/input-element-DPKoFVwJ.cjs +1 -0
- package/dist/{input-wrapper-6vTrKtsW.js → input-wrapper-BTQk3W8T.js} +10 -10
- 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-BlWQ8jOv.js → linkcard-CUrbzjLK.js} +16 -17
- package/dist/linkcard-DSu3A4Yx.cjs +13 -0
- package/dist/messagebox-C1aWoQbu.cjs +12 -0
- package/dist/messagebox-LpiVQIoM.js +107 -0
- package/dist/{modal-DYTVJjYh.cjs → modal-Avai5eVz.cjs} +2 -2
- package/dist/{modal-3OZTPqee.js → modal-Co1YFmHi.js} +8 -8
- package/dist/pkt-alert.cjs +1 -27
- package/dist/pkt-alert.js +4 -157
- 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 -168
- 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 -30
- 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 -107
- 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 -105
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-progressbar.cjs +1 -0
- package/dist/pkt-progressbar.js +6 -0
- package/dist/pkt-slot-controller-Ckk_yV0j.cjs +1 -0
- package/dist/pkt-slot-controller-RJvOnbF4.js +61 -0
- package/dist/pkt-tag.cjs +1 -17
- package/dist/pkt-tag.js +4 -148
- 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-BS_oawSB.js +150 -0
- package/dist/progressbar-CuXkbAhJ.cjs +32 -0
- package/dist/ref-DCOsLZQg.cjs +13 -0
- package/dist/ref-DuFGTLVX.js +142 -0
- 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-BTpJjEhO.js → textarea-BAGWR1Hi.js} +29 -29
- package/dist/textarea-BiUrhAlk.cjs +48 -0
- package/dist/{textinput-BIhQEr8z.cjs → textinput-CHOR5PPp.cjs} +2 -2
- package/dist/{textinput-CVo5wG14.js → textinput-pJ3N8m6g.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 +29 -15
- 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/index.ts +12 -0
- package/src/components/progressbar/progressbar.ts +144 -0
- 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/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-DX41tnbj.cjs +0 -46
- package/dist/linkcard-Det6CJ5D.cjs +0 -13
- package/dist/pkt-component-template.cjs +0 -29
- package/dist/pkt-component-template.js +0 -99
- package/dist/pkt-element.cjs +0 -1
- package/dist/pkt-element.js +0 -5
- package/dist/ref-C2yPtMJA.cjs +0 -13
- package/dist/ref-CaiKp3S2.js +0 -202
- package/dist/textarea-B45ZZYpx.cjs +0 -48
- package/src/components/component-template/index.ts +0 -129
- package/src/components/element/index.ts +0 -353
- /package/dist/{component-template.d.ts → progressbar.d.ts} +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { classMap } from 'lit/directives/class-map.js'
|
|
2
|
+
import { ifDefined } from 'lit/directives/if-defined.js'
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js'
|
|
4
|
+
import { html, nothing } from 'lit'
|
|
5
|
+
import { IPktTag } from '../tag/tag'
|
|
6
|
+
import { PktElement } from '@/base-elements/element'
|
|
7
|
+
import { PktSlotController } from '@/controllers/pkt-slot-controller'
|
|
8
|
+
import { ref, createRef, Ref } from 'lit/directives/ref.js'
|
|
9
|
+
import specs from 'componentSpecs/card.json'
|
|
10
|
+
import '../icon/icon'
|
|
11
|
+
import '../tag/tag'
|
|
12
|
+
|
|
13
|
+
export type TCardSkin = 'outlined' | 'gray' | 'beige' | 'green' | 'blue'
|
|
14
|
+
export type TDirection = 'portrait' | 'landscape'
|
|
15
|
+
|
|
16
|
+
@customElement('pkt-card')
|
|
17
|
+
export class PktCard extends PktElement {
|
|
18
|
+
defaultSlot: Ref<HTMLElement> = createRef()
|
|
19
|
+
|
|
20
|
+
constructor() {
|
|
21
|
+
super()
|
|
22
|
+
this.slotController = new PktSlotController(this, this.defaultSlot)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@property({ type: String, reflect: true }) skin: TCardSkin = specs.props.skin.default as TCardSkin
|
|
26
|
+
@property({ type: String, reflect: true }) direction: TDirection = specs.props.direction
|
|
27
|
+
.default as TDirection
|
|
28
|
+
@property({ type: Object, reflect: true }) image: { src: string; alt: string } = {
|
|
29
|
+
src: '',
|
|
30
|
+
alt: '',
|
|
31
|
+
}
|
|
32
|
+
@property({ type: String, reflect: true }) heading: string = ''
|
|
33
|
+
@property({ type: String, reflect: true }) subheading: string = ''
|
|
34
|
+
@property({ type: Array, reflect: true }) tags: (Omit<IPktTag, 'closeTag'> & { text: string })[] =
|
|
35
|
+
[]
|
|
36
|
+
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
super.connectedCallback()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
render() {
|
|
42
|
+
const classes = {
|
|
43
|
+
'pkt-card': true,
|
|
44
|
+
[`pkt-card--${this.skin}`]: this.skin,
|
|
45
|
+
[`pkt-card--${this.direction}`]: this.direction,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return html`
|
|
49
|
+
<div class=${classMap(classes)}>
|
|
50
|
+
${this.image.src &&
|
|
51
|
+
html`
|
|
52
|
+
<div class="pkt-card__image">
|
|
53
|
+
<img src=${this.image.src} alt=${this.image.alt || ''} />
|
|
54
|
+
</div>
|
|
55
|
+
`}
|
|
56
|
+
<div class="pkt-card__wrapper">
|
|
57
|
+
${this.tags.length > 0
|
|
58
|
+
? html`
|
|
59
|
+
<div class="pkt-card__tags">
|
|
60
|
+
${this.tags.map(
|
|
61
|
+
(tag) => html`
|
|
62
|
+
<pkt-tag textStyle="normal-text" size="medium" skin=${ifDefined(tag.skin)}>
|
|
63
|
+
${tag.text}
|
|
64
|
+
</pkt-tag>
|
|
65
|
+
`,
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
`
|
|
69
|
+
: nothing}
|
|
70
|
+
${this.heading && html`<h3 class="pkt-txt-30-medium">${this.heading}</h3>`}
|
|
71
|
+
${this.subheading && html`<p class="pkt-txt-20-light">${this.subheading}</p>`}
|
|
72
|
+
${this.defaultSlot &&
|
|
73
|
+
html`<div class="pkt-card__content" ${ref(this.defaultSlot)}></div>`}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
`
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -1,77 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { PktElement } from '../element'
|
|
6
|
-
import { PktSlotController } from '../../controllers/pkt-slot-controller'
|
|
7
|
-
import { ref, createRef, Ref } from 'lit/directives/ref.js'
|
|
8
|
-
import specs from 'componentSpecs/card.json'
|
|
9
|
-
import '../icon'
|
|
10
|
-
import '../tag'
|
|
11
|
-
|
|
12
|
-
export type ICardSkin = 'outlined' | 'gray' | 'beige' | 'green' | 'blue'
|
|
13
|
-
export type IDirection = 'portrait' | 'landscape'
|
|
14
|
-
|
|
15
|
-
@customElement('pkt-card')
|
|
16
|
-
export class PktCard extends PktElement {
|
|
17
|
-
defaultSlot: Ref<HTMLElement> = createRef()
|
|
18
|
-
|
|
19
|
-
constructor() {
|
|
20
|
-
super()
|
|
21
|
-
this.slotController = new PktSlotController(this, this.defaultSlot)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@property({ type: String, reflect: true }) skin: ICardSkin = specs.props.skin.default as ICardSkin
|
|
25
|
-
@property({ type: String, reflect: true }) direction: IDirection = specs.props.direction
|
|
26
|
-
.default as IDirection
|
|
27
|
-
@property({ type: Object, reflect: true }) image: { src: string; alt: string } = {
|
|
28
|
-
src: '',
|
|
29
|
-
alt: '',
|
|
30
|
-
}
|
|
31
|
-
@property({ type: String, reflect: true }) heading: string = ''
|
|
32
|
-
@property({ type: String, reflect: true }) subheading: string = ''
|
|
33
|
-
@property({ type: Array, reflect: true }) tags: (Omit<IPktTag, 'closeTag'> & { text: string })[] =
|
|
34
|
-
[]
|
|
35
|
-
|
|
36
|
-
connectedCallback() {
|
|
37
|
-
super.connectedCallback()
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
render() {
|
|
41
|
-
const classes = {
|
|
42
|
-
'pkt-card': true,
|
|
43
|
-
[`pkt-card--${this.skin}`]: this.skin,
|
|
44
|
-
[`pkt-card--${this.direction}`]: this.direction,
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return html`
|
|
48
|
-
<div class=${classMap(classes)}>
|
|
49
|
-
${this.image.src &&
|
|
50
|
-
html`
|
|
51
|
-
<div class="pkt-card__image">
|
|
52
|
-
<img src=${this.image.src} alt=${this.image.alt || ''} />
|
|
53
|
-
</div>
|
|
54
|
-
`}
|
|
55
|
-
<div class="pkt-card__wrapper">
|
|
56
|
-
${this.tags.length > 0
|
|
57
|
-
? html`
|
|
58
|
-
<div class="pkt-card__tags">
|
|
59
|
-
${this.tags.map(
|
|
60
|
-
(tag) => html`
|
|
61
|
-
<pkt-tag textStyle="normal-text" size="medium" skin=${tag.skin}>
|
|
62
|
-
${tag.text}
|
|
63
|
-
</pkt-tag>
|
|
64
|
-
`,
|
|
65
|
-
)}
|
|
66
|
-
</div>
|
|
67
|
-
`
|
|
68
|
-
: nothing}
|
|
69
|
-
${this.heading && html`<h3 class="pkt-txt-30-medium">${this.heading}</h3>`}
|
|
70
|
-
${this.subheading && html`<p class="pkt-txt-20-light">${this.subheading}</p>`}
|
|
71
|
-
${this.defaultSlot &&
|
|
72
|
-
html`<div class="pkt-card__content" ${ref(this.defaultSlot)}></div>`}
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
`
|
|
76
|
-
}
|
|
77
|
-
}
|
|
1
|
+
import { PktCard } from './card'
|
|
2
|
+
import type { TCardSkin, TDirection } from './card'
|
|
3
|
+
export { PktCard, TCardSkin, TDirection }
|
|
4
|
+
export default PktCard
|