@progressive-development/pd-contact 0.1.66 → 0.1.68

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 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.66",
6
+ "version": "0.1.68",
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
9
  "scripts": {
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
- .phone-icon {
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
- phoneCallLink: { type: Boolean },
132
+ phoneMailLink: { type: Boolean },
112
133
  /**
113
134
  * summary (true) or view (false) contact data
114
135
  */
@@ -348,7 +369,7 @@ function transformPhone(phone, country) {
348
369
  }
349
370
 
350
371
  _renderViewContact() {
351
- const trPhoneNr = transformPhone(this.contact.phone1, this.contact.country || "de");
372
+ const trPhoneNr = transformPhone(this.contact.phone1, this.contact.country || "be");
352
373
  return html`
353
374
  <address>
354
375
  <dl>
@@ -362,15 +383,28 @@ 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.phoneCallLink && trPhoneNr ? html`
386
+
387
+ ${this.contact.phone1 ? html`
388
+ <dd class="larger">${this.phoneMailLink && trPhoneNr ? html`
366
389
  <a href="${`tel:${trPhoneNr}`}"
367
390
  aria-label="${`Phone call: ${this.contact.phone1}`}"
368
- style="display: flex; align-items: center; text-decoration: none; color: inherit;">
391
+ class="link-item">
369
392
  <span style="margin-right: 8px;">${this.contact.phone1}</span>
370
- <pd-icon icon="phoneIcon" class="round small phone-icon"></pd-icon>
393
+ <pd-icon activeIcon icon="phoneIcon" class="round link-icon"></pd-icon>
371
394
  </a>
372
395
  ` : this.contact.phone1}</dd>
373
- <dd>${this.contact.email}</dd>
396
+ ` : ''}
397
+
398
+ ${this.contact.email ? html`
399
+ <dd class="larger">${this.phoneMailLink ? html`
400
+ <a href="${`mailto:${this.contact.email}`}"
401
+ aria-label="${`Send mail: ${this.contact.email}`}"
402
+ class="link-item">
403
+ <span style="margin-right: 8px;">${this.contact.email}</span>
404
+ <pd-icon activeIcon icon="mailIcon" class="round link-icon"></pd-icon>
405
+ </a>
406
+ ` : this.contact.email}</dd>
407
+ ` : ''}
374
408
 
375
409
  ${this.contact.btw
376
410
  ? html`<dt>BTW</dt>
@@ -15,11 +15,11 @@ function Template() {
15
15
  `;
16
16
  }
17
17
 
18
- function TemplateView({summary, phoneCallLink}) {
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}" ?phoneCallLink="${phoneCallLink}" .contact="${{
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
- phoneCallLink: "true"
65
+ phoneMailLink: "true"
66
66
  };
67
67
 
68
68
  export const ContactPreparedForm = TemplateView.bind({});