playbook_ui 11.2.3 → 11.2.5
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_contact/{_contact.jsx → _contact.tsx} +14 -11
- data/lib/playbook/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd92a1775a844fd8f606c1acd266c5ce645b45dd625195efdcd6a416ed8b5fa7
|
4
|
+
data.tar.gz: 3f27c1389870c46b76d5032b0c06480899095c920ed61d80c331d2f35de9e6fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53d6e1bb4c838f0f36a5e53f96c85756f2514c4fa27038f4e3d8f462cc5d7106c9252ee0614d47a5e47f4b68ee3ee22c2bf2c3d72e95d3ccb76d4c021167fba9
|
7
|
+
data.tar.gz: ecef6c648cd16239a594e8f6df5a6cd45699362beb921fb71a42c349b44e2d387327aef0337e89ee11a1b826c40abaacafadd9580bdaf47d5b921f551e9b7284
|
@@ -1,5 +1,3 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
1
|
import React from 'react'
|
4
2
|
import classnames from 'classnames'
|
5
3
|
|
@@ -10,7 +8,7 @@ import Body from '../pb_body/_body'
|
|
10
8
|
import Caption from '../pb_caption/_caption'
|
11
9
|
import Icon from '../pb_icon/_icon'
|
12
10
|
|
13
|
-
const contactTypeMap = {
|
11
|
+
const contactTypeMap: { [key: string]: string; } = {
|
14
12
|
'cell': 'mobile',
|
15
13
|
'email': 'envelope',
|
16
14
|
'home': 'phone',
|
@@ -20,14 +18,17 @@ const contactTypeMap = {
|
|
20
18
|
'extension': 'phone-plus',
|
21
19
|
}
|
22
20
|
|
23
|
-
const formatContact = (contactString, contactType) => {
|
21
|
+
const formatContact = (contactString: string, contactType: string) => {
|
24
22
|
if (contactType == 'email') return contactString
|
23
|
+
|
25
24
|
const cleaned = contactString.replace(/\D/g, '')
|
25
|
+
const phoneNumber = cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/)
|
26
|
+
|
26
27
|
if(contactType == 'extension') {
|
27
28
|
return cleaned.match(/^\d{4}$/)
|
28
29
|
}
|
29
|
-
|
30
|
-
|
30
|
+
|
31
|
+
if (phoneNumber) {
|
31
32
|
const intlCode = phoneNumber[1] ? '+1 ' : ''
|
32
33
|
return [
|
33
34
|
intlCode,
|
@@ -39,12 +40,13 @@ const formatContact = (contactString, contactType) => {
|
|
39
40
|
phoneNumber[4],
|
40
41
|
].join('')
|
41
42
|
}
|
43
|
+
|
42
44
|
return null
|
43
45
|
}
|
44
46
|
|
45
47
|
type ContactProps = {
|
46
|
-
aria?:
|
47
|
-
className?: string |
|
48
|
+
aria?: { [key: string]: string; },
|
49
|
+
className?: string | string[],
|
48
50
|
contactDetail?: string,
|
49
51
|
contactType?: string,
|
50
52
|
contactValue: string,
|
@@ -85,16 +87,17 @@ const Contact = (props: ContactProps) => {
|
|
85
87
|
icon={contactTypeMap[contactType] || 'phone'}
|
86
88
|
/>
|
87
89
|
{` ${formatContact(contactValue, contactType)} `}
|
88
|
-
|
90
|
+
{
|
91
|
+
contactDetail &&
|
89
92
|
<Caption
|
90
93
|
size="xs"
|
91
94
|
tag="span"
|
92
95
|
text={contactDetail}
|
93
96
|
/>
|
94
|
-
|
97
|
+
}
|
95
98
|
</Body>
|
96
99
|
</div>
|
97
100
|
)
|
98
101
|
}
|
99
102
|
|
100
|
-
export default Contact
|
103
|
+
export default Contact
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.2.
|
4
|
+
version: 11.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-08-
|
12
|
+
date: 2022-08-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -584,8 +584,8 @@ files:
|
|
584
584
|
- app/pb_kits/playbook/pb_collapsible/docs/example.yml
|
585
585
|
- app/pb_kits/playbook/pb_collapsible/docs/index.js
|
586
586
|
- app/pb_kits/playbook/pb_collapsible/index.js
|
587
|
-
- app/pb_kits/playbook/pb_contact/_contact.jsx
|
588
587
|
- app/pb_kits/playbook/pb_contact/_contact.scss
|
588
|
+
- app/pb_kits/playbook/pb_contact/_contact.tsx
|
589
589
|
- app/pb_kits/playbook/pb_contact/contact.html.erb
|
590
590
|
- app/pb_kits/playbook/pb_contact/contact.rb
|
591
591
|
- app/pb_kits/playbook/pb_contact/contact.test.js
|