@progressive-development/pd-contact 0.1.65 → 0.1.67
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/package.json +2 -2
- package/src/PdContact.js +34 -6
- package/stories/index.stories.js +3 -3
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Progressive Development Contact component",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "PD Progressive Development",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.67",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"module": "index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"storybook:build": "npm run analyze -- --exclude dist && build-storybook"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@progressive-development/pd-forms": "^0.2.
|
|
20
|
+
"@progressive-development/pd-forms": "^0.2.16",
|
|
21
21
|
"@progressive-development/pd-icon": "^0.1.21",
|
|
22
22
|
"@progressive-development/pd-shared-styles": "^0.1.1",
|
|
23
23
|
"lit": "^2.2.0"
|
package/src/PdContact.js
CHANGED
|
@@ -90,13 +90,34 @@ function transformPhone(phone, country) {
|
|
|
90
90
|
padding: 0;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
dd.larger {
|
|
94
|
+
padding-top: 3px;
|
|
95
|
+
padding-bottom: 5px;
|
|
96
|
+
}
|
|
97
|
+
|
|
93
98
|
.contact-form {
|
|
94
99
|
--row-padding-top: 10px;
|
|
95
100
|
}
|
|
96
101
|
|
|
97
|
-
.
|
|
102
|
+
.link-icon {
|
|
103
|
+
--pd-icon-bg-col-active: #859900;
|
|
104
|
+
--pd-icon-bg-col-hover: #859900;
|
|
105
|
+
--pd-icon-size: 14px;
|
|
106
|
+
--pd-icon-stroke-col-active: white;
|
|
107
|
+
--pd-icon-col-active: white;
|
|
108
|
+
}
|
|
98
109
|
|
|
110
|
+
.link-item {
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
text-decoration: none;
|
|
114
|
+
color: var(--pd-default-font-link-col, inherit);
|
|
99
115
|
}
|
|
116
|
+
|
|
117
|
+
.link-item:hover {
|
|
118
|
+
color: var(--pd-default-font-link-col-hover, #451A46) ;
|
|
119
|
+
}
|
|
120
|
+
|
|
100
121
|
`];
|
|
101
122
|
}
|
|
102
123
|
|
|
@@ -108,7 +129,7 @@ function transformPhone(phone, country) {
|
|
|
108
129
|
/**
|
|
109
130
|
* show (true) or not (false) tel number as link
|
|
110
131
|
*/
|
|
111
|
-
|
|
132
|
+
phoneMailLink: { type: Boolean },
|
|
112
133
|
/**
|
|
113
134
|
* summary (true) or view (false) contact data
|
|
114
135
|
*/
|
|
@@ -362,15 +383,22 @@ function transformPhone(phone, country) {
|
|
|
362
383
|
<dd>${this._getFullLocation()}</dd>
|
|
363
384
|
${this.contact.additionalHint ? html`<dd>${this.contact.additionalHint}</dd>` : ''}
|
|
364
385
|
<dd>${this.contact.country}</dd>
|
|
365
|
-
<dd>${this.
|
|
386
|
+
<dd class="larger">${this.phoneMailLink && trPhoneNr ? html`
|
|
366
387
|
<a href="${`tel:${trPhoneNr}`}"
|
|
367
388
|
aria-label="${`Phone call: ${this.contact.phone1}`}"
|
|
368
|
-
|
|
389
|
+
class="link-item">
|
|
369
390
|
<span style="margin-right: 8px;">${this.contact.phone1}</span>
|
|
370
|
-
<pd-icon icon="phoneIcon" class="round
|
|
391
|
+
<pd-icon activeIcon icon="phoneIcon" class="round link-icon"></pd-icon>
|
|
371
392
|
</a>
|
|
372
393
|
` : this.contact.phone1}</dd>
|
|
373
|
-
|
|
394
|
+
<dd class="larger">${this.phoneMailLink ? html`
|
|
395
|
+
<a href="${`mailto:${this.contact.email}`}"
|
|
396
|
+
aria-label="${`Send mail: ${this.contact.email}`}"
|
|
397
|
+
class="link-item">
|
|
398
|
+
<span style="margin-right: 8px;">${this.contact.email}</span>
|
|
399
|
+
<pd-icon activeIcon icon="mailIcon" class="round link-icon"></pd-icon>
|
|
400
|
+
</a>
|
|
401
|
+
` : this.contact.email}</dd>
|
|
374
402
|
|
|
375
403
|
${this.contact.btw
|
|
376
404
|
? html`<dt>BTW</dt>
|
package/stories/index.stories.js
CHANGED
|
@@ -15,11 +15,11 @@ function Template() {
|
|
|
15
15
|
`;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function TemplateView({summary,
|
|
18
|
+
function TemplateView({summary, phoneMailLink}) {
|
|
19
19
|
console.log(summary);
|
|
20
20
|
return html`
|
|
21
21
|
<h3>View Contact</h3>
|
|
22
|
-
<pd-contact ?summary="${summary}" ?
|
|
22
|
+
<pd-contact ?summary="${summary}" ?phoneMailLink="${phoneMailLink}" .contact="${{
|
|
23
23
|
firstName: 'Peter',
|
|
24
24
|
lastName: 'Musterman',
|
|
25
25
|
street: 'Musterstrasse',
|
|
@@ -62,7 +62,7 @@ ContactView.args = {
|
|
|
62
62
|
export const ContactViewPhone = TemplateView.bind({});
|
|
63
63
|
ContactViewPhone.args = {
|
|
64
64
|
summary: "true",
|
|
65
|
-
|
|
65
|
+
phoneMailLink: "true"
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
export const ContactPreparedForm = TemplateView.bind({});
|