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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82d64d3a520c7686c11f94af071b4e8b4468b8d8d87f577dec65aba9a4f2fb7e
4
- data.tar.gz: 99c685c816a9c1a98d31396432efdea39b6326457fe735329c6fcce13edb3341
3
+ metadata.gz: bd92a1775a844fd8f606c1acd266c5ce645b45dd625195efdcd6a416ed8b5fa7
4
+ data.tar.gz: 3f27c1389870c46b76d5032b0c06480899095c920ed61d80c331d2f35de9e6fe
5
5
  SHA512:
6
- metadata.gz: 6c7851307f9349a1ced3fdfe99007dfab302f5e1a9f382c12adba66dd9fef6aa44b4d4797e5e7ec69f78912f21bb5b0908cef85a14f8fc36205a2124adb2c36a
7
- data.tar.gz: 943a1cf45bb44e0916fd5e557fc12ed7595c99bb18a99e2724ed3da68cd9eccee27e2a5b17f17c43e2c66158f5d6071280376f756fdb3fd1b9dec7ea30fedf26
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
- if (contactType !== 'email') {
30
- const phoneNumber = cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/)
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?: object,
47
- className?: string | array<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
- <If condition={contactDetail}>
90
+ {
91
+ contactDetail &&
89
92
  <Caption
90
93
  size="xs"
91
94
  tag="span"
92
95
  text={contactDetail}
93
96
  />
94
- </If>
97
+ }
95
98
  </Body>
96
99
  </div>
97
100
  )
98
101
  }
99
102
 
100
- export default Contact
103
+ export default Contact
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "11.2.2"
5
- VERSION = "11.2.3"
4
+ PREVIOUS_VERSION = "11.2.4"
5
+ VERSION = "11.2.5"
6
6
  end
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.3
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-04 00:00:00.000000000 Z
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