@postnord/pn-marketweb-components 2.4.28 → 2.4.29
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/cjs/index-4199ff85.js +4 -0
- package/cjs/loader.cjs.js +1 -1
- package/cjs/pn-cta-block.cjs.entry.js +33 -0
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/collection/collection-manifest.json +1 -0
- package/collection/components/cta/pn-cta-block/cta-block.stories.js +252 -0
- package/collection/components/cta/pn-cta-block/pn-cta-block.css +187 -0
- package/collection/components/cta/pn-cta-block/pn-cta-block.js +169 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/pn-cta-block.d.ts +11 -0
- package/components/pn-cta-block.js +57 -0
- package/esm/index-ee44c065.js +4 -0
- package/esm/loader.js +1 -1
- package/esm/pn-cta-block.entry.js +29 -0
- package/esm/pn-market-web-components.js +1 -1
- package/esm-es5/index-ee44c065.js +1 -1
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-cta-block.entry.js +1 -0
- package/esm-es5/pn-market-web-components.js +1 -1
- package/package.json +1 -1
- package/pn-market-web-components/p-71740e7e.system.entry.js +1 -0
- package/pn-market-web-components/p-f02617fc.entry.js +1 -0
- package/pn-market-web-components/p-fcdb7381.system.js +1 -1
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/types/components/cta/pn-cta-block/pn-cta-block.d.ts +14 -0
- package/types/components.d.ts +27 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import readme from "./readme.md";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "CTA/Cta block",
|
|
5
|
+
parameters: {
|
|
6
|
+
notes: readme,
|
|
7
|
+
},
|
|
8
|
+
argTypes: {
|
|
9
|
+
pnBackgroundColor: {
|
|
10
|
+
options: ['blue25', 'coral50', 'gray25', 'green25'],
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
},
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const Template = ({ ...args }) => {
|
|
18
|
+
return `
|
|
19
|
+
<pn-breakpoints break-point-class="dotcom"></pn-breakpoints>
|
|
20
|
+
<div style="max-width: 1410px">
|
|
21
|
+
<pn-cta-block
|
|
22
|
+
is-centered="${args.isCentered}"
|
|
23
|
+
is-large="${args.isLarge}"
|
|
24
|
+
is-small="${args.isSmall}"
|
|
25
|
+
pn-background-color="${args.pnBackgroundColor}"
|
|
26
|
+
heading="${args.heading}"
|
|
27
|
+
body-text="${args.bodyText}"
|
|
28
|
+
content-top="${args.contentTop}">
|
|
29
|
+
<div slot="illustration">
|
|
30
|
+
<picture>
|
|
31
|
+
<img src="https://www.postnord.se/contentassets/5fe2c739644149e79d73c1082e575af3/success.svg" />
|
|
32
|
+
</picture>
|
|
33
|
+
</div>
|
|
34
|
+
<div slot="cta-button">
|
|
35
|
+
<pn-button class="cta-block__button " href=${args.buttonUrl}>${args.buttonText}</pn-button>
|
|
36
|
+
<a href=${args.linkUrl}>${args.linkText} <pn-icon symbol="arrow-right"> </pn-icon></a>
|
|
37
|
+
</div>
|
|
38
|
+
</pn-cta-block>
|
|
39
|
+
</div>
|
|
40
|
+
`;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Primary = Template.bind({});
|
|
44
|
+
Primary.args = {
|
|
45
|
+
contentTop: false,
|
|
46
|
+
heading: 'PostNord erbjuder mycket',
|
|
47
|
+
bodyText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eu dolor mauris. Integer sed nulla id justo faucibus vestibulum consequat et ligula. Vestibulum varius quam in porttitor pellentesque.',
|
|
48
|
+
buttonText: "Våra tjänster",
|
|
49
|
+
buttonUrl: 'http://www.google.se',
|
|
50
|
+
linkText: 'Information',
|
|
51
|
+
linkUrl: 'http://www.bing.com',
|
|
52
|
+
pnBackgroundColor: ['blue25'],
|
|
53
|
+
isLarge: false,
|
|
54
|
+
isCentered: false,
|
|
55
|
+
isSmall: false,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const LinkOnlyTemplate = ({ ...args }) => {
|
|
59
|
+
return `
|
|
60
|
+
<div style="max-width: 1410px">
|
|
61
|
+
<pn-cta-block
|
|
62
|
+
is-centered="${args.isCentered}"
|
|
63
|
+
is-large="${args.isLarge}"
|
|
64
|
+
is-small="${args.isSmall}"
|
|
65
|
+
pn-background-color="${args.pnBackgroundColor}"
|
|
66
|
+
heading="${args.heading}"
|
|
67
|
+
body-text="${args.bodyText}"
|
|
68
|
+
content-top="${args.contentTop}">
|
|
69
|
+
<div slot="illustration">
|
|
70
|
+
<picture>
|
|
71
|
+
<img src="https://www.postnord.se/contentassets/5fe2c739644149e79d73c1082e575af3/success.svg" />
|
|
72
|
+
</picture>
|
|
73
|
+
</div>
|
|
74
|
+
<div slot="cta-button">
|
|
75
|
+
<pn-button class="cta-block__button " href=${args.buttonUrl}>${args.buttonText}</pn-button>
|
|
76
|
+
<a href=${args.linkUrl}>${args.linkText} <pn-icon symbol="arrow-right"> </pn-icon></a>
|
|
77
|
+
</div>
|
|
78
|
+
</pn-cta-block>
|
|
79
|
+
</div>
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const LinkOnly = LinkOnlyTemplate.bind({});
|
|
84
|
+
LinkOnly.args = {
|
|
85
|
+
heading: 'PostNord erbjuder mycket',
|
|
86
|
+
bodyText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eu dolor mauris. Integer sed nulla id justo faucibus vestibulum consequat et ligula. Vestibulum varius quam in porttitor pellentesque.',
|
|
87
|
+
buttonText: "Våra tjänster",
|
|
88
|
+
buttonUrl: '',
|
|
89
|
+
linkText: 'Information',
|
|
90
|
+
linkUrl: 'http://www.bing.com',
|
|
91
|
+
pnBackgroundColor: ['gray25'],
|
|
92
|
+
isLarge: true,
|
|
93
|
+
isCentered: false,
|
|
94
|
+
isSmall: false,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
const TwoButtonLayoutTemplate = ({ ...args }) => {
|
|
99
|
+
return `
|
|
100
|
+
<div style="max-width: 1410px">
|
|
101
|
+
<pn-cta-block
|
|
102
|
+
is-centered="${args.isCentered}"
|
|
103
|
+
is-large="${args.isLarge}"
|
|
104
|
+
is-small="${args.isSmall}"
|
|
105
|
+
pn-background-color="${args.pnBackgroundColor}"
|
|
106
|
+
heading="${args.heading}"
|
|
107
|
+
body-text="${args.bodyText}"
|
|
108
|
+
content-top="${args.contentTop}">
|
|
109
|
+
<div slot="illustration">
|
|
110
|
+
<picture>
|
|
111
|
+
<img src="https://www.postnord.se/contentassets/5fe2c739644149e79d73c1082e575af3/success.svg" />
|
|
112
|
+
</picture>
|
|
113
|
+
</div>
|
|
114
|
+
<div slot="cta-button">
|
|
115
|
+
<pn-button class="cta-block__button " href=${args.buttonUrl}>${args.buttonText}</pn-button>
|
|
116
|
+
<pn-button appearance="light" class="cta-block__button " href=${args.buttonUrl}>${args.buttonText}</pn-button>
|
|
117
|
+
</div>
|
|
118
|
+
</pn-cta-block>
|
|
119
|
+
</div>
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const TwoButtonLayout = TwoButtonLayoutTemplate.bind({});
|
|
124
|
+
TwoButtonLayout.args = {
|
|
125
|
+
heading: 'PostNord erbjuder mycket',
|
|
126
|
+
bodyText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eu dolor mauris. Integer sed nulla id justo faucibus vestibulum consequat et ligula. Vestibulum varius quam in porttitor pellentesque.',
|
|
127
|
+
buttonText: "Våra tjänster",
|
|
128
|
+
buttonUrl: 'http://www.google.se',
|
|
129
|
+
linkText: 'Information',
|
|
130
|
+
linkUrl: 'http://www.bing.com',
|
|
131
|
+
pnBackgroundColor: ['coral50'],
|
|
132
|
+
isLarge: true,
|
|
133
|
+
isCentered: false,
|
|
134
|
+
isSmall: false,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const NoImageTemplate = ({ ...args }) => {
|
|
138
|
+
return `
|
|
139
|
+
<div style="max-width: 1410px">
|
|
140
|
+
<pn-cta-block
|
|
141
|
+
is-centered="${args.isCentered}"
|
|
142
|
+
is-large="${args.isLarge}"
|
|
143
|
+
is-small="${args.isSmall}"
|
|
144
|
+
pn-background-color="${args.pnBackgroundColor}"
|
|
145
|
+
heading="${args.heading}"
|
|
146
|
+
body-text="${args.bodyText}"
|
|
147
|
+
content-top="${args.contentTop}">
|
|
148
|
+
<div slot="illustration">
|
|
149
|
+
<picture>
|
|
150
|
+
<img src="https://www.postnord.se/contentassets/5fe2c739644149e79d73c1082e575af3/success.svg" />
|
|
151
|
+
</picture>
|
|
152
|
+
</div>
|
|
153
|
+
<div slot="cta-button">
|
|
154
|
+
<pn-button class="cta-block__button " href=${args.buttonUrl}>${args.buttonText}</pn-button>
|
|
155
|
+
<a href=${args.linkUrl}>${args.linkText} <pn-icon symbol="arrow-right"> </pn-icon></a>
|
|
156
|
+
</div>
|
|
157
|
+
</pn-cta-block>
|
|
158
|
+
</div>
|
|
159
|
+
`;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export const NoImage = NoImageTemplate.bind({});
|
|
163
|
+
NoImage.args = {
|
|
164
|
+
heading: 'PostNord erbjuder mycket',
|
|
165
|
+
bodyText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eu dolor mauris. Integer sed nulla id justo faucibus vestibulum consequat et ligula. Vestibulum varius quam in porttitor pellentesque.',
|
|
166
|
+
buttonText: "Våra tjänster",
|
|
167
|
+
buttonUrl: 'http://www.google.se',
|
|
168
|
+
linkText: 'Information',
|
|
169
|
+
linkUrl: '',
|
|
170
|
+
pnBackgroundColor: ['gray25'],
|
|
171
|
+
isLarge: true,
|
|
172
|
+
isCentered: false,
|
|
173
|
+
isSmall: false,
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const LargeTemplate = ({ ...args }) => {
|
|
177
|
+
return `
|
|
178
|
+
<div style="max-width: 1410px">
|
|
179
|
+
<pn-cta-block
|
|
180
|
+
is-centered="${args.isCentered}"
|
|
181
|
+
is-large="${args.isLarge}"
|
|
182
|
+
is-small="${args.isSmall}"
|
|
183
|
+
pn-background-color="${args.pnBackgroundColor}"
|
|
184
|
+
heading="${args.heading}"
|
|
185
|
+
body-text="${args.bodyText}"
|
|
186
|
+
content-top="${args.contentTop}">
|
|
187
|
+
<div slot="illustration">
|
|
188
|
+
<picture>
|
|
189
|
+
<img src="https://www.postnord.se/contentassets/5fe2c739644149e79d73c1082e575af3/success.svg" />
|
|
190
|
+
</picture>
|
|
191
|
+
</div>
|
|
192
|
+
<div slot="cta-button">
|
|
193
|
+
<pn-button class="cta-block__button " href=${args.buttonUrl}>${args.buttonText}</pn-button>
|
|
194
|
+
<a href=${args.linkUrl}>${args.linkText} <pn-icon symbol="arrow-right"> </pn-icon></a>
|
|
195
|
+
</div>
|
|
196
|
+
</pn-cta-block>
|
|
197
|
+
</div>
|
|
198
|
+
`;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export const Large = LargeTemplate.bind({});
|
|
202
|
+
Large.args = {
|
|
203
|
+
heading: 'PostNord erbjuder mycket',
|
|
204
|
+
bodyText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eu dolor mauris. Integer sed nulla id justo faucibus vestibulum consequat et ligula. Vestibulum varius quam in porttitor pellentesque.',
|
|
205
|
+
buttonText: "Våra tjänster",
|
|
206
|
+
buttonUrl: 'http://www.google.se',
|
|
207
|
+
linkText: 'Information',
|
|
208
|
+
linkUrl: 'http://www.bing.com',
|
|
209
|
+
pnBackgroundColor: ['blue25'],
|
|
210
|
+
isLarge: true,
|
|
211
|
+
isCentered: false,
|
|
212
|
+
isSmall: false,
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const LargeCenteredTemplate = ({ ...args }) => {
|
|
216
|
+
return `
|
|
217
|
+
<div style="max-width: 1410px">
|
|
218
|
+
<pn-cta-block
|
|
219
|
+
is-centered="${args.isCentered}"
|
|
220
|
+
is-large="${args.isLarge}"
|
|
221
|
+
is-small="${args.isSmall}"
|
|
222
|
+
pn-background-color="${args.pnBackgroundColor}"
|
|
223
|
+
heading="${args.heading}"
|
|
224
|
+
body-text="${args.bodyText}"
|
|
225
|
+
content-top="${args.contentTop}">
|
|
226
|
+
<div slot="illustration">
|
|
227
|
+
<picture>
|
|
228
|
+
<img src="https://www.postnord.se/contentassets/5fe2c739644149e79d73c1082e575af3/success.svg" />
|
|
229
|
+
</picture>
|
|
230
|
+
</div>
|
|
231
|
+
<div slot="cta-button">
|
|
232
|
+
<pn-button class="cta-block__button " href=${args.buttonUrl}>${args.buttonText}</pn-button>
|
|
233
|
+
<a href=${args.linkUrl}>${args.linkText} <pn-icon symbol="arrow-right"> </pn-icon></a>
|
|
234
|
+
</div>
|
|
235
|
+
</pn-cta-block>
|
|
236
|
+
</div>
|
|
237
|
+
`;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export const LargeCentered = LargeCenteredTemplate.bind({});
|
|
241
|
+
LargeCentered.args = {
|
|
242
|
+
heading: 'PostNord erbjuder mycket',
|
|
243
|
+
bodyText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eu dolor mauris. Integer sed nulla id justo faucibus vestibulum consequat et ligula. Vestibulum varius quam in porttitor pellentesque.',
|
|
244
|
+
buttonText: "Våra tjänster",
|
|
245
|
+
buttonUrl: 'http://www.google.se',
|
|
246
|
+
linkText: 'Information',
|
|
247
|
+
linkUrl: 'http://www.bing.com',
|
|
248
|
+
pnBackgroundColor: ['blue25'],
|
|
249
|
+
isLarge: true,
|
|
250
|
+
isCentered: true,
|
|
251
|
+
isSmall: false,
|
|
252
|
+
};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
pn-cta-block .cta-block {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
border-radius: 2.4rem;
|
|
6
|
+
padding: 3.2rem 2.4rem;
|
|
7
|
+
width: 100%;
|
|
8
|
+
}
|
|
9
|
+
@media screen and (min-width: 768px) {
|
|
10
|
+
pn-cta-block .cta-block {
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
padding: 2.4rem;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
@media screen and (min-width: 1140px) {
|
|
16
|
+
pn-cta-block .cta-block {
|
|
17
|
+
margin-right: auto;
|
|
18
|
+
margin-left: auto;
|
|
19
|
+
max-width: 95%;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
@media screen and (min-width: 1440px) {
|
|
23
|
+
pn-cta-block .cta-block {
|
|
24
|
+
max-width: 90%;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
pn-cta-block .cta-block[pn-background-color=blue25] {
|
|
28
|
+
background-color: #EFFBFF;
|
|
29
|
+
}
|
|
30
|
+
pn-cta-block .cta-block[pn-background-color=coral50] {
|
|
31
|
+
background-color: #FDEFEE;
|
|
32
|
+
}
|
|
33
|
+
pn-cta-block .cta-block[pn-background-color=gray25] {
|
|
34
|
+
background-color: #F9F8F8;
|
|
35
|
+
}
|
|
36
|
+
pn-cta-block .cta-block[pn-background-color=green25] {
|
|
37
|
+
background-color: #EDFBF3;
|
|
38
|
+
}
|
|
39
|
+
pn-cta-block .cta-block--content-top .cta-block__content {
|
|
40
|
+
justify-content: flex-start;
|
|
41
|
+
}
|
|
42
|
+
@media screen and (min-width: 768px) {
|
|
43
|
+
pn-cta-block .cta-block--large .cta-block__heading {
|
|
44
|
+
font-size: 3.6rem;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
@media screen and (min-width: 768px) {
|
|
48
|
+
pn-cta-block .cta-block--large .cta-block__text {
|
|
49
|
+
font-size: 2rem;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
pn-cta-block .cta-block--small {
|
|
53
|
+
margin-right: auto;
|
|
54
|
+
margin-left: auto;
|
|
55
|
+
width: auto;
|
|
56
|
+
}
|
|
57
|
+
@media screen and (min-width: 992px) {
|
|
58
|
+
pn-cta-block .cta-block--small {
|
|
59
|
+
max-width: 75%;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
pn-cta-block .cta-block--center {
|
|
63
|
+
align-items: center;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
gap: 1.6rem;
|
|
66
|
+
padding: 3.2rem 2.4rem;
|
|
67
|
+
text-align: center;
|
|
68
|
+
}
|
|
69
|
+
@media screen and (min-width: 768px) {
|
|
70
|
+
pn-cta-block .cta-block--center .cta-block__content {
|
|
71
|
+
max-width: 74rem;
|
|
72
|
+
padding: 0;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
pn-cta-block .cta-block--center .cta-block__action {
|
|
76
|
+
margin-top: 0.8rem;
|
|
77
|
+
}
|
|
78
|
+
pn-cta-block .cta-block--center .cta-block__action > [slot=cta-button] {
|
|
79
|
+
gap: 0.8rem;
|
|
80
|
+
}
|
|
81
|
+
@media screen and (min-width: 768px) {
|
|
82
|
+
pn-cta-block .cta-block--center .cta-block__action {
|
|
83
|
+
flex-direction: row;
|
|
84
|
+
gap: 2.4rem;
|
|
85
|
+
margin-top: 1.6rem;
|
|
86
|
+
}
|
|
87
|
+
pn-cta-block .cta-block--center .cta-block__action.cta-block__button {
|
|
88
|
+
margin-bottom: 0;
|
|
89
|
+
}
|
|
90
|
+
pn-cta-block .cta-block--center .cta-block__action > [slot=cta-button] {
|
|
91
|
+
flex-direction: row;
|
|
92
|
+
gap: 2.4rem;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
@media screen and (min-width: 768px) {
|
|
96
|
+
pn-cta-block .cta-block--center .cta-block__image-wrapper {
|
|
97
|
+
display: block;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
pn-cta-block .cta-block--center .cta-block__image-wrapper > [slot=illustration] {
|
|
101
|
+
padding-right: 0;
|
|
102
|
+
}
|
|
103
|
+
pn-cta-block .cta-block__image-wrapper {
|
|
104
|
+
margin-bottom: 1.6rem;
|
|
105
|
+
}
|
|
106
|
+
pn-cta-block .cta-block__image-wrapper > [slot=illustration] > picture > img {
|
|
107
|
+
border-radius: 0.8rem;
|
|
108
|
+
max-width: 100%;
|
|
109
|
+
}
|
|
110
|
+
@media screen and (min-width: 768px) {
|
|
111
|
+
pn-cta-block .cta-block__image-wrapper {
|
|
112
|
+
display: none;
|
|
113
|
+
max-width: 20%;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
@media screen and (min-width: 992px) {
|
|
117
|
+
pn-cta-block .cta-block__image-wrapper {
|
|
118
|
+
display: block;
|
|
119
|
+
margin-bottom: 0;
|
|
120
|
+
}
|
|
121
|
+
pn-cta-block .cta-block__image-wrapper > [slot=illustration] {
|
|
122
|
+
padding-right: 3.2rem;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
pn-cta-block .cta-block__content {
|
|
126
|
+
display: flex;
|
|
127
|
+
flex: 1;
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
}
|
|
131
|
+
@media screen and (min-width: 768px) {
|
|
132
|
+
pn-cta-block .cta-block__content {
|
|
133
|
+
padding-right: 2.4rem;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
@media screen and (min-width: 768px) {
|
|
137
|
+
pn-cta-block .cta-block__content .cta-block__heading {
|
|
138
|
+
max-width: 74rem;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
pn-cta-block .cta-block__content .cta-block__text {
|
|
142
|
+
margin-bottom: 2.4rem;
|
|
143
|
+
}
|
|
144
|
+
@media screen and (min-width: 768px) {
|
|
145
|
+
pn-cta-block .cta-block__content .cta-block__text {
|
|
146
|
+
max-width: 74rem;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
pn-cta-block .cta-block__heading {
|
|
150
|
+
margin-bottom: 0.8rem;
|
|
151
|
+
}
|
|
152
|
+
pn-cta-block .cta-block__action {
|
|
153
|
+
display: flex;
|
|
154
|
+
}
|
|
155
|
+
pn-cta-block .cta-block__action > [slot=cta-button] {
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
row-gap: 1.6rem;
|
|
161
|
+
}
|
|
162
|
+
@media screen and (min-width: 768px) {
|
|
163
|
+
pn-cta-block .cta-block__action > [slot=cta-button] {
|
|
164
|
+
gap: 1.6rem;
|
|
165
|
+
margin-top: 0;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
pn-cta-block .cta-block__action > [slot=cta-button] > a {
|
|
169
|
+
color: #005D92;
|
|
170
|
+
font-weight: 500;
|
|
171
|
+
font-size: 1.6rem;
|
|
172
|
+
padding: 0.1rem;
|
|
173
|
+
text-decoration: none;
|
|
174
|
+
}
|
|
175
|
+
pn-cta-block .cta-block__action > [slot=cta-button] > a pn-icon svg {
|
|
176
|
+
transition: transform 0.3s ease-in-out;
|
|
177
|
+
}
|
|
178
|
+
pn-cta-block .cta-block__action > [slot=cta-button] > a pn-icon svg path {
|
|
179
|
+
fill: #005D92;
|
|
180
|
+
}
|
|
181
|
+
pn-cta-block .cta-block__action > [slot=cta-button] > a:hover pn-icon svg {
|
|
182
|
+
transition: transform 0.3s ease-in-out;
|
|
183
|
+
transform: translateX(0.3rem);
|
|
184
|
+
}
|
|
185
|
+
pn-cta-block .cta-block__action > [slot=cta-button] > a:hover pn-icon svg path {
|
|
186
|
+
fill: #005D92;
|
|
187
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class PnCtaBlock {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.heading = null;
|
|
5
|
+
this.bodyText = null;
|
|
6
|
+
this.pnBackgroundColor = null;
|
|
7
|
+
this.isLarge = false;
|
|
8
|
+
this.isCentered = false;
|
|
9
|
+
this.isSmall = false;
|
|
10
|
+
this.contentTop = false;
|
|
11
|
+
this.hasIllustrationSlot = true;
|
|
12
|
+
this.hasButtonSlot = true;
|
|
13
|
+
}
|
|
14
|
+
componentWillLoad() {
|
|
15
|
+
this.hasIllustrationSlot = !!this.hostElement.querySelector('[slot="illustration"]');
|
|
16
|
+
this.hasButtonSlot = !!this.hostElement.querySelector('[slot="cta-button"]');
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return (h(Host, null, h("div", { "pn-background-color": this.pnBackgroundColor, class: `cta-block ${this.isLarge ? 'cta-block--large' : ''} ${this.isCentered ? 'cta-block--center' : ''} ${(this.isSmall ? 'cta-block--small' : '')} ${this.contentTop ? 'cta-block--content-top' : ''}` }, h("div", { class: "cta-block__image-wrapper" }, h("slot", { name: "illustration" })), h("div", { class: "cta-block__content" }, h("h2", { class: "cta-block__heading" }, this.heading), h("p", { class: "cta-block__text" }, this.bodyText)), h("div", { class: "cta-block__action" }, h("slot", { name: "cta-button" })))));
|
|
20
|
+
}
|
|
21
|
+
static get is() { return "pn-cta-block"; }
|
|
22
|
+
static get originalStyleUrls() {
|
|
23
|
+
return {
|
|
24
|
+
"$": ["pn-cta-block.scss"]
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
static get styleUrls() {
|
|
28
|
+
return {
|
|
29
|
+
"$": ["pn-cta-block.css"]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static get properties() {
|
|
33
|
+
return {
|
|
34
|
+
"heading": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"mutable": false,
|
|
37
|
+
"complexType": {
|
|
38
|
+
"original": "string",
|
|
39
|
+
"resolved": "string",
|
|
40
|
+
"references": {}
|
|
41
|
+
},
|
|
42
|
+
"required": false,
|
|
43
|
+
"optional": false,
|
|
44
|
+
"docs": {
|
|
45
|
+
"tags": [],
|
|
46
|
+
"text": ""
|
|
47
|
+
},
|
|
48
|
+
"attribute": "heading",
|
|
49
|
+
"reflect": false,
|
|
50
|
+
"defaultValue": "null"
|
|
51
|
+
},
|
|
52
|
+
"bodyText": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"mutable": false,
|
|
55
|
+
"complexType": {
|
|
56
|
+
"original": "string",
|
|
57
|
+
"resolved": "string",
|
|
58
|
+
"references": {}
|
|
59
|
+
},
|
|
60
|
+
"required": false,
|
|
61
|
+
"optional": false,
|
|
62
|
+
"docs": {
|
|
63
|
+
"tags": [],
|
|
64
|
+
"text": ""
|
|
65
|
+
},
|
|
66
|
+
"attribute": "body-text",
|
|
67
|
+
"reflect": false,
|
|
68
|
+
"defaultValue": "null"
|
|
69
|
+
},
|
|
70
|
+
"pnBackgroundColor": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"mutable": false,
|
|
73
|
+
"complexType": {
|
|
74
|
+
"original": "string",
|
|
75
|
+
"resolved": "string",
|
|
76
|
+
"references": {}
|
|
77
|
+
},
|
|
78
|
+
"required": false,
|
|
79
|
+
"optional": false,
|
|
80
|
+
"docs": {
|
|
81
|
+
"tags": [],
|
|
82
|
+
"text": ""
|
|
83
|
+
},
|
|
84
|
+
"attribute": "pn-background-color",
|
|
85
|
+
"reflect": false,
|
|
86
|
+
"defaultValue": "null"
|
|
87
|
+
},
|
|
88
|
+
"isLarge": {
|
|
89
|
+
"type": "boolean",
|
|
90
|
+
"mutable": false,
|
|
91
|
+
"complexType": {
|
|
92
|
+
"original": "boolean",
|
|
93
|
+
"resolved": "boolean",
|
|
94
|
+
"references": {}
|
|
95
|
+
},
|
|
96
|
+
"required": false,
|
|
97
|
+
"optional": false,
|
|
98
|
+
"docs": {
|
|
99
|
+
"tags": [],
|
|
100
|
+
"text": ""
|
|
101
|
+
},
|
|
102
|
+
"attribute": "is-large",
|
|
103
|
+
"reflect": false,
|
|
104
|
+
"defaultValue": "false"
|
|
105
|
+
},
|
|
106
|
+
"isCentered": {
|
|
107
|
+
"type": "boolean",
|
|
108
|
+
"mutable": false,
|
|
109
|
+
"complexType": {
|
|
110
|
+
"original": "boolean",
|
|
111
|
+
"resolved": "boolean",
|
|
112
|
+
"references": {}
|
|
113
|
+
},
|
|
114
|
+
"required": false,
|
|
115
|
+
"optional": false,
|
|
116
|
+
"docs": {
|
|
117
|
+
"tags": [],
|
|
118
|
+
"text": ""
|
|
119
|
+
},
|
|
120
|
+
"attribute": "is-centered",
|
|
121
|
+
"reflect": false,
|
|
122
|
+
"defaultValue": "false"
|
|
123
|
+
},
|
|
124
|
+
"isSmall": {
|
|
125
|
+
"type": "boolean",
|
|
126
|
+
"mutable": false,
|
|
127
|
+
"complexType": {
|
|
128
|
+
"original": "boolean",
|
|
129
|
+
"resolved": "boolean",
|
|
130
|
+
"references": {}
|
|
131
|
+
},
|
|
132
|
+
"required": false,
|
|
133
|
+
"optional": false,
|
|
134
|
+
"docs": {
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": ""
|
|
137
|
+
},
|
|
138
|
+
"attribute": "is-small",
|
|
139
|
+
"reflect": false,
|
|
140
|
+
"defaultValue": "false"
|
|
141
|
+
},
|
|
142
|
+
"contentTop": {
|
|
143
|
+
"type": "boolean",
|
|
144
|
+
"mutable": false,
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "boolean",
|
|
147
|
+
"resolved": "boolean",
|
|
148
|
+
"references": {}
|
|
149
|
+
},
|
|
150
|
+
"required": false,
|
|
151
|
+
"optional": false,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": ""
|
|
155
|
+
},
|
|
156
|
+
"attribute": "content-top",
|
|
157
|
+
"reflect": false,
|
|
158
|
+
"defaultValue": "false"
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
static get states() {
|
|
163
|
+
return {
|
|
164
|
+
"hasIllustrationSlot": {},
|
|
165
|
+
"hasButtonSlot": {}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
static get elementRef() { return "hostElement"; }
|
|
169
|
+
}
|
package/components/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { PnBreakpoints as PnBreakpoints } from '../types/components/utilities/pn
|
|
|
8
8
|
export { PnChart as PnChart } from '../types/components/charts/pn-chart/pn-chart';
|
|
9
9
|
export { PnChartsCard as PnChartsCard } from '../types/components/charts/pn-charts-card/pn-charts-card';
|
|
10
10
|
export { PnChoiceButton as PnChoiceButton } from '../types/components/input/pn-choice-button/pn-choice-button';
|
|
11
|
+
export { PnCtaBlock as PnCtaBlock } from '../types/components/cta/pn-cta-block/pn-cta-block';
|
|
11
12
|
export { PnCustomernumberSelector as PnCustomernumberSelector } from '../types/components/profile/pn-customernumber-selector/pn-customernumber-selector';
|
|
12
13
|
export { PnProfileSelectorOption as PnCustomernumberSelectorOption } from '../types/components/profile/pn-customernumber-selector/pn-customernumber-selector-option';
|
|
13
14
|
export { PnDateAndTime as PnDateAndTime } from '../types/components/input/pn-date-and-time/pn-date-and-time';
|
package/components/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { PnBreakpoints, defineCustomElement as defineCustomElementPnBreakpoints
|
|
|
8
8
|
export { PnChart, defineCustomElement as defineCustomElementPnChart } from './pn-chart.js';
|
|
9
9
|
export { PnChartsCard, defineCustomElement as defineCustomElementPnChartsCard } from './pn-charts-card.js';
|
|
10
10
|
export { PnChoiceButton, defineCustomElement as defineCustomElementPnChoiceButton } from './pn-choice-button.js';
|
|
11
|
+
export { PnCtaBlock, defineCustomElement as defineCustomElementPnCtaBlock } from './pn-cta-block.js';
|
|
11
12
|
export { PnCustomernumberSelector, defineCustomElement as defineCustomElementPnCustomernumberSelector } from './pn-customernumber-selector.js';
|
|
12
13
|
export { PnCustomernumberSelectorOption, defineCustomElement as defineCustomElementPnCustomernumberSelectorOption } from './pn-customernumber-selector-option.js';
|
|
13
14
|
export { PnDateAndTime, defineCustomElement as defineCustomElementPnDateAndTime } from './pn-date-and-time.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PnCtaBlock extends Components.PnCtaBlock, HTMLElement {}
|
|
4
|
+
export const PnCtaBlock: {
|
|
5
|
+
prototype: PnCtaBlock;
|
|
6
|
+
new (): PnCtaBlock;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|