@postnord/pn-marketweb-components 1.0.44-beta1 → 1.0.44-beta2

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.
Files changed (58) hide show
  1. package/cjs/loader.cjs.js +1 -1
  2. package/cjs/pn-find-price-result.cjs.entry.js +5 -15
  3. package/cjs/{pn-find-price-store-85b100ba.js → pn-find-price-store-d9aabecb.js} +1 -0
  4. package/cjs/pn-find-price.cjs.entry.js +48 -65
  5. package/cjs/pn-market-web-components.cjs.js +1 -1
  6. package/cjs/pn-product-card_3.cjs.entry.js +49 -0
  7. package/collection/collection-manifest.json +3 -0
  8. package/collection/components/widgets/pn-find-price/data.js +36 -62
  9. package/collection/components/widgets/pn-find-price/pn-find-price-result.css +6 -0
  10. package/collection/components/widgets/pn-find-price/pn-find-price-result.js +18 -24
  11. package/collection/components/widgets/pn-find-price/pn-find-price-store.js +1 -0
  12. package/collection/components/widgets/pn-find-price/pn-find-price-translations.js +6 -4
  13. package/collection/components/widgets/pn-find-price/pn-find-price.css +1 -0
  14. package/collection/components/widgets/pn-find-price/pn-find-price.js +5 -0
  15. package/collection/components/widgets/pn-product-card/pn-product-card-info.css +30 -0
  16. package/collection/components/widgets/pn-product-card/pn-product-card-info.js +92 -0
  17. package/collection/components/widgets/pn-product-card/pn-product-card-price.css +37 -0
  18. package/collection/components/widgets/pn-product-card/pn-product-card-price.js +112 -0
  19. package/collection/components/widgets/pn-product-card/pn-product-card.css +86 -0
  20. package/collection/components/widgets/pn-product-card/pn-product-card.js +26 -0
  21. package/collection/components/widgets/pn-product-card/product-card.stories.js +50 -0
  22. package/custom-elements/index.d.ts +18 -0
  23. package/custom-elements/index.js +102 -79
  24. package/esm/loader.js +1 -1
  25. package/esm/pn-find-price-result.entry.js +5 -15
  26. package/esm/{pn-find-price-store-d2053b72.js → pn-find-price-store-8560f26c.js} +1 -0
  27. package/esm/pn-find-price.entry.js +48 -65
  28. package/esm/pn-market-web-components.js +1 -1
  29. package/esm/pn-product-card_3.entry.js +43 -0
  30. package/esm-es5/loader.js +1 -1
  31. package/esm-es5/pn-find-price-result.entry.js +1 -1
  32. package/esm-es5/{pn-find-price-store-d2053b72.js → pn-find-price-store-8560f26c.js} +1 -1
  33. package/esm-es5/pn-find-price.entry.js +1 -1
  34. package/esm-es5/pn-market-web-components.js +1 -1
  35. package/esm-es5/pn-product-card_3.entry.js +1 -0
  36. package/package.json +7 -6
  37. package/pn-market-web-components/p-0fb48ff6.entry.js +1 -0
  38. package/pn-market-web-components/p-1051c2d9.system.entry.js +1 -0
  39. package/pn-market-web-components/{p-c30207e6.js → p-390d9a03.js} +1 -1
  40. package/pn-market-web-components/p-492e6f0d.system.js +1 -0
  41. package/pn-market-web-components/p-80ca78f4.entry.js +1 -0
  42. package/pn-market-web-components/p-a22df959.system.js +1 -1
  43. package/pn-market-web-components/p-a425e095.system.entry.js +1 -0
  44. package/pn-market-web-components/p-b42fd0cb.entry.js +1 -0
  45. package/pn-market-web-components/p-f2898a60.system.entry.js +1 -0
  46. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  47. package/types/components/widgets/pn-find-price/pn-find-price-store.d.ts +2 -0
  48. package/types/components/widgets/pn-find-price/pn-find-price-translations.d.ts +2 -0
  49. package/types/components/widgets/pn-find-price/pn-find-price-types.d.ts +6 -1
  50. package/types/components/widgets/pn-product-card/pn-product-card-info.d.ts +7 -0
  51. package/types/components/widgets/pn-product-card/pn-product-card-price.d.ts +8 -0
  52. package/types/components/widgets/pn-product-card/pn-product-card.d.ts +3 -0
  53. package/types/components.d.ts +57 -0
  54. package/pn-market-web-components/p-233ca151.system.js +0 -1
  55. package/pn-market-web-components/p-4fcabdb8.entry.js +0 -1
  56. package/pn-market-web-components/p-b30e348c.system.entry.js +0 -1
  57. package/pn-market-web-components/p-bea2dcc6.entry.js +0 -1
  58. package/pn-market-web-components/p-d8882f68.system.entry.js +0 -1
@@ -0,0 +1,30 @@
1
+ pn-product-card-info {
2
+ align-self: center;
3
+ }
4
+
5
+ .cardinfocontent {
6
+ display: flex;
7
+ flex-direction: row;
8
+ justify-content: space-between;
9
+ flex-grow: 1;
10
+ font-size: 0.875em;
11
+ }
12
+ .cardinfocontent > div {
13
+ margin: 10px;
14
+ }
15
+
16
+ [slot=formatPre] {
17
+ font-size: 1em;
18
+ font-family: "PostNordSans", "Verdana";
19
+ }
20
+ [slot=formatPre] > strong {
21
+ font-weight: bold;
22
+ }
23
+
24
+ .cardinfoprice {
25
+ display: flex;
26
+ font-size: 1em;
27
+ flex-direction: row;
28
+ justify-content: center;
29
+ flex-grow: 1;
30
+ }
@@ -0,0 +1,92 @@
1
+ import { Component, h, Prop, Host } from "@stencil/core";
2
+ export class PnProductCardInfo {
3
+ render() {
4
+ return (this.label) ? (h(Host, null,
5
+ h("div", { class: "cardinfocontent" }, (this.text) ? (h("pre", { slot: "formatPre" }, this.text)) : null))) : (h(Host, null,
6
+ h("div", { class: "cardinfocontent" },
7
+ h("div", null,
8
+ h("h4", null, "Paket:"),
9
+ h("pre", { slot: "formatPre" }, this.paket)),
10
+ h("div", null,
11
+ h("h4", null, "Rulle:"),
12
+ h("pre", { slot: "formatPre" }, this.rulle)))));
13
+ }
14
+ static get is() { return "pn-product-card-info"; }
15
+ static get originalStyleUrls() { return {
16
+ "$": ["pn-product-card-info.scss"]
17
+ }; }
18
+ static get styleUrls() { return {
19
+ "$": ["pn-product-card-info.css"]
20
+ }; }
21
+ static get properties() { return {
22
+ "rulle": {
23
+ "type": "string",
24
+ "mutable": false,
25
+ "complexType": {
26
+ "original": "string",
27
+ "resolved": "string",
28
+ "references": {}
29
+ },
30
+ "required": false,
31
+ "optional": false,
32
+ "docs": {
33
+ "tags": [],
34
+ "text": ""
35
+ },
36
+ "attribute": "rulle",
37
+ "reflect": false
38
+ },
39
+ "paket": {
40
+ "type": "string",
41
+ "mutable": false,
42
+ "complexType": {
43
+ "original": "string",
44
+ "resolved": "string",
45
+ "references": {}
46
+ },
47
+ "required": false,
48
+ "optional": false,
49
+ "docs": {
50
+ "tags": [],
51
+ "text": ""
52
+ },
53
+ "attribute": "paket",
54
+ "reflect": false
55
+ },
56
+ "label": {
57
+ "type": "string",
58
+ "mutable": false,
59
+ "complexType": {
60
+ "original": "string",
61
+ "resolved": "string",
62
+ "references": {}
63
+ },
64
+ "required": false,
65
+ "optional": false,
66
+ "docs": {
67
+ "tags": [],
68
+ "text": ""
69
+ },
70
+ "attribute": "label",
71
+ "reflect": false
72
+ },
73
+ "text": {
74
+ "type": "string",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "string",
78
+ "resolved": "string",
79
+ "references": {}
80
+ },
81
+ "required": false,
82
+ "optional": false,
83
+ "docs": {
84
+ "tags": [],
85
+ "text": ""
86
+ },
87
+ "attribute": "text",
88
+ "reflect": false
89
+ }
90
+ }; }
91
+ }
92
+ h("pn-icon", { symbol: "align-center", small: "false", color: "black" });
@@ -0,0 +1,37 @@
1
+ pn-product-card-price {
2
+ margin-top: 1em;
3
+ white-space: nowrap;
4
+ text-align: center;
5
+ }
6
+ pn-product-card-price span {
7
+ font-size: 1.25em;
8
+ }
9
+ pn-product-card-price span:last-child {
10
+ display: inline-block;
11
+ margin-left: 0.2em;
12
+ }
13
+ pn-product-card-price + pn-product-card-price {
14
+ margin-left: 1.5em;
15
+ }
16
+ pn-product-card-price pn-icon {
17
+ display: inline-block;
18
+ align-self: center;
19
+ }
20
+ pn-product-card-price pn-button {
21
+ width: 12.8em;
22
+ margin-bottom: 1em;
23
+ margin-top: 0.5em;
24
+ }
25
+ pn-product-card-price p {
26
+ font-weight: lighter;
27
+ font-size: 0.6em;
28
+ align-self: center;
29
+ margin-top: 0.5em;
30
+ }
31
+ pn-product-card-price a {
32
+ text-decoration: none;
33
+ color: #005D92;
34
+ }
35
+ pn-product-card-price a h3 {
36
+ text-decoration: underline;
37
+ }
@@ -0,0 +1,112 @@
1
+ import { Component, h, Prop, Host } from "@stencil/core";
2
+ export class PnProductCardPrice {
3
+ render() {
4
+ if (!this.amount) {
5
+ return;
6
+ }
7
+ return (this.url) ? (h(Host, null,
8
+ h("h3", null,
9
+ (this.amount) ? (h("span", null, this.amount)) : null,
10
+ (this.currency) ? (h("span", null, this.currency)) : null,
11
+ (this.note) ? (h("p", null, this.note)) : null),
12
+ (this.label) ? (h("a", { href: this.url },
13
+ h("pn-button", { small: "true", icon: "arrow-right", appearance: "secondary" }, this.label))) : null)) : (h(Host, null,
14
+ h("h3", null,
15
+ (this.amount) ? (h("span", null, this.amount)) : null,
16
+ (this.currency) ? (h("span", null, this.currency)) : null)));
17
+ }
18
+ static get is() { return "pn-product-card-price"; }
19
+ static get originalStyleUrls() { return {
20
+ "$": ["pn-product-card-price.scss"]
21
+ }; }
22
+ static get styleUrls() { return {
23
+ "$": ["pn-product-card-price.css"]
24
+ }; }
25
+ static get properties() { return {
26
+ "label": {
27
+ "type": "string",
28
+ "mutable": false,
29
+ "complexType": {
30
+ "original": "string",
31
+ "resolved": "string",
32
+ "references": {}
33
+ },
34
+ "required": false,
35
+ "optional": false,
36
+ "docs": {
37
+ "tags": [],
38
+ "text": ""
39
+ },
40
+ "attribute": "label",
41
+ "reflect": false
42
+ },
43
+ "amount": {
44
+ "type": "string",
45
+ "mutable": false,
46
+ "complexType": {
47
+ "original": "string",
48
+ "resolved": "string",
49
+ "references": {}
50
+ },
51
+ "required": false,
52
+ "optional": false,
53
+ "docs": {
54
+ "tags": [],
55
+ "text": ""
56
+ },
57
+ "attribute": "amount",
58
+ "reflect": false
59
+ },
60
+ "currency": {
61
+ "type": "string",
62
+ "mutable": false,
63
+ "complexType": {
64
+ "original": "string",
65
+ "resolved": "string",
66
+ "references": {}
67
+ },
68
+ "required": false,
69
+ "optional": false,
70
+ "docs": {
71
+ "tags": [],
72
+ "text": ""
73
+ },
74
+ "attribute": "currency",
75
+ "reflect": false
76
+ },
77
+ "note": {
78
+ "type": "string",
79
+ "mutable": false,
80
+ "complexType": {
81
+ "original": "string",
82
+ "resolved": "string",
83
+ "references": {}
84
+ },
85
+ "required": false,
86
+ "optional": false,
87
+ "docs": {
88
+ "tags": [],
89
+ "text": ""
90
+ },
91
+ "attribute": "note",
92
+ "reflect": false
93
+ },
94
+ "url": {
95
+ "type": "string",
96
+ "mutable": false,
97
+ "complexType": {
98
+ "original": "string",
99
+ "resolved": "string",
100
+ "references": {}
101
+ },
102
+ "required": false,
103
+ "optional": false,
104
+ "docs": {
105
+ "tags": [],
106
+ "text": ""
107
+ },
108
+ "attribute": "url",
109
+ "reflect": false
110
+ }
111
+ }; }
112
+ }
@@ -0,0 +1,86 @@
1
+ pn-product-card {
2
+ margin-bottom: 1em;
3
+ border: 0.1rem solid #D3CECB;
4
+ outline: none;
5
+ background: white;
6
+ box-shadow: 0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);
7
+ display: flex;
8
+ padding: 1.5em;
9
+ word-break: break-word;
10
+ text-decoration: none;
11
+ border-radius: 0.8rem;
12
+ }
13
+ pn-product-card [slot=content] h3 {
14
+ display: flex;
15
+ width: 100%;
16
+ margin-bottom: 0.5em;
17
+ }
18
+ pn-product-card [slot=content] h3 > [slot=Biligast] {
19
+ font-size: 0.6em;
20
+ background: #005E41;
21
+ color: white;
22
+ border-radius: 0.37em;
23
+ width: 4em;
24
+ line-height: 2em;
25
+ text-align: center;
26
+ margin-left: 0.6em;
27
+ font-weight: normal;
28
+ }
29
+ pn-product-card [slot=content] h3 > [slot=Snabbast] {
30
+ font-size: 0.6em;
31
+ background: #005D92;
32
+ color: white;
33
+ border-radius: 0.37em;
34
+ width: 5em;
35
+ line-height: 2em;
36
+ text-align: center;
37
+ vertical-align: bottom;
38
+ margin-left: 0.6em;
39
+ font-weight: normal;
40
+ }
41
+ pn-product-card [slot=additionalUSP] {
42
+ font-size: 0.6em;
43
+ background: #D3CECB;
44
+ color: #2D2013;
45
+ border-radius: 0.25em;
46
+ width: fit-content;
47
+ padding: 0.3em;
48
+ margin-top: 0.5em;
49
+ }
50
+ pn-product-card > pn-illustration {
51
+ min-width: 8rem;
52
+ width: 8rem;
53
+ height: 8rem;
54
+ margin-right: 3rem;
55
+ align-self: center;
56
+ }
57
+ pn-product-card .cardcontent {
58
+ display: flex;
59
+ flex-direction: row;
60
+ justify-content: center;
61
+ flex-grow: 1;
62
+ }
63
+ pn-product-card .cardprice {
64
+ display: flex;
65
+ font-size: 1em;
66
+ flex-direction: row;
67
+ justify-content: center;
68
+ flex-grow: 1;
69
+ }
70
+ pn-product-card .details {
71
+ display: flex;
72
+ flex-direction: column;
73
+ justify-content: space-between;
74
+ width: 100%;
75
+ }
76
+ pn-product-card .info {
77
+ display: flex;
78
+ justify-content: space-between;
79
+ flex-grow: 1;
80
+ max-width: 66.6666666667%;
81
+ flex-flow: wrap;
82
+ }
83
+ pn-product-card .info > * {
84
+ min-width: 6em;
85
+ margin: 0.2em 1em 0.2em 0;
86
+ }
@@ -0,0 +1,26 @@
1
+ import { Component, h, Host } from "@stencil/core";
2
+ export class PnProductCard {
3
+ render() {
4
+ return (h(Host, null,
5
+ h("slot", { name: "illustration" }),
6
+ h("div", { class: "cardcontent" },
7
+ h("div", { class: "details" },
8
+ h("slot", { name: "content" }),
9
+ h("div", { class: "info" },
10
+ h("slot", null)),
11
+ h("slot", { name: "note" }),
12
+ h("slot", { name: "additionalUSP" })),
13
+ h("div", { class: "cardprice" },
14
+ h("div", null,
15
+ h("slot", { name: "price" }),
16
+ h("slot", { name: "sendDirectPrice" }),
17
+ h("slot", { name: "stampPrice" }))))));
18
+ }
19
+ static get is() { return "pn-product-card"; }
20
+ static get originalStyleUrls() { return {
21
+ "$": ["pn-product-card.scss"]
22
+ }; }
23
+ static get styleUrls() { return {
24
+ "$": ["pn-product-card.css"]
25
+ }; }
26
+ }
@@ -0,0 +1,50 @@
1
+ import readme from "./readme.md";
2
+
3
+ export default {
4
+ title: "Widgets/Product Card",
5
+ parameters: {
6
+ notes: readme
7
+ }
8
+ };
9
+
10
+ const Template = ({ ...args }) => {
11
+ return `
12
+ <div style="max-width: 30em; margin:1em auto 0;">
13
+ <pn-product-card>
14
+ <div slot="content">
15
+ <h3>${args.heading}</h3>
16
+ <p>${args.description}</p>
17
+ </div>
18
+ <pn-product-card-info label="${args.info1label}" text="${args.info1value}"></pn-product-card-info>
19
+ <pn-product-card-info label="${args.info2label}" text="${args.info2value}"></pn-product-card-info>
20
+ <pn-product-card-price slot="price" label="${args.pricelabel}" amount="${args.priceamount}" currency="${args.pricecurrency}"></pn-product-card-price>
21
+ </pn-product-card>
22
+ </div>
23
+ `;
24
+ };
25
+
26
+ export const Primary = Template.bind({});
27
+ Primary.args = {
28
+ heading: "Skicka hem",
29
+ description: "Lorem ipsum dolor sit amet",
30
+ info1label: "Maxvikt",
31
+ info1value: "250g",
32
+ info2label: "Max längd + bredd + höjd",
33
+ info2value: "90cm",
34
+ pricelabel: "Skicka direkt",
35
+ priceamount: "52",
36
+ pricecurrency: "kr"
37
+ };
38
+
39
+ export const Secondary = Template.bind({});
40
+ Secondary.args = {
41
+ heading: "",
42
+ description: "",
43
+ info1label: "Maxvikt",
44
+ info1value: "250g",
45
+ info2label: "Max längd + bredd + höjd",
46
+ info2value: "90cm",
47
+ pricelabel: "Skicka direkt",
48
+ priceamount: "52",
49
+ pricecurrency: "kr"
50
+ };
@@ -122,6 +122,24 @@ export const PnPexPricefinder: {
122
122
  new (): PnPexPricefinder;
123
123
  };
124
124
 
125
+ interface PnProductCard extends Components.PnProductCard, HTMLElement {}
126
+ export const PnProductCard: {
127
+ prototype: PnProductCard;
128
+ new (): PnProductCard;
129
+ };
130
+
131
+ interface PnProductCardInfo extends Components.PnProductCardInfo, HTMLElement {}
132
+ export const PnProductCardInfo: {
133
+ prototype: PnProductCardInfo;
134
+ new (): PnProductCardInfo;
135
+ };
136
+
137
+ interface PnProductCardPrice extends Components.PnProductCardPrice, HTMLElement {}
138
+ export const PnProductCardPrice: {
139
+ prototype: PnProductCardPrice;
140
+ new (): PnProductCardPrice;
141
+ };
142
+
125
143
  interface PnProductPricelist extends Components.PnProductPricelist, HTMLElement {}
126
144
  export const PnProductPricelist: {
127
145
  prototype: PnProductPricelist;