playbook_ui 14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4028 → 14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4037

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: 4f4c94c493daf726dc039b1e497273b1e399c416834b47f90f5f1de5adfdfcd3
4
- data.tar.gz: db7bf747a4cec3dda4fe95fe8957a0a062a23de1cd60b52b76657c4763233bab
3
+ metadata.gz: a06ad76a5b0490f9a83f4327fd8a9dd388d2ed6fa1ee83dc72d6ca6a5071ae5c
4
+ data.tar.gz: 42bfb4eb362d27094685c06ad868c9c5bfb8ebb70960b50df06da156125b9fc1
5
5
  SHA512:
6
- metadata.gz: 6e92e7dddd11a4e60ca9a98ab50cfb53d5e08f86a2d0a485b4a84bbfd1159d80dcc4dad718d1d115ae377f24e239c77e90588a00134d985cff50958c217e8a23
7
- data.tar.gz: d314e1f5b3e4bb8eed249e0229a89e3415b2f1fd93a510818870ade9521b0995789623ea33b200caf2bc1eb0c39a597c6804dccbd49c6683ba50a0cb6cdf86cc
6
+ metadata.gz: 4bafbfe0895af6e9f6548d7cced94e4c0b341f6a68957d81ea1d47c31ee00fd27b72e90e9028c27a23f6a990dbdc528651aca7e71fd81d0bcd996cc44537adbc
7
+ data.tar.gz: e632b6fc5da05678aed09cd65a0cc4a6e772e1dcfc5d556546dbd5356644813da9210ac1ab2765bec1f4a38efc9187d7b9a1969cbf9d19ed410004041190dbfb
@@ -18,6 +18,18 @@ $flag-min-resolution: 192dpi;
18
18
  display: none;
19
19
  }
20
20
 
21
+ .iti__selected-dial-code {
22
+ font-family: $font_family_base;
23
+ font-size: $font_base;
24
+ line-height: 1.5;
25
+ letter-spacing: $lspace_normal;
26
+ font-weight: $regular;
27
+ font-style: normal;
28
+ text-rendering: optimizeLegibility;
29
+ -moz-font-feature-settings: "liga" on;
30
+ color: $charcoal;
31
+ }
32
+
21
33
  input::placeholder {
22
34
  color: $focus_input_light;
23
35
  }
@@ -46,6 +58,9 @@ $flag-min-resolution: 192dpi;
46
58
  justify-content: center;
47
59
  align-items: center;
48
60
  margin-right: 10px;
61
+ .iti__flag {
62
+ margin-right: 0;
63
+ }
49
64
  }
50
65
 
51
66
  .iti__selected-country {
@@ -133,7 +148,7 @@ $flag-min-resolution: 192dpi;
133
148
 
134
149
  .iti__arrow.iti__arrow--up::before {
135
150
  transform: rotate(-($transform-rotate-deg/3));
136
- top: $space_xs + 4px;
151
+ top: $space_xs + 1px;
137
152
  color: $primary_action;
138
153
  }
139
154
 
@@ -1,8 +1,7 @@
1
1
  import React, { forwardRef, useEffect, useRef, useState, useImperativeHandle } from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
- import intlTelInput from 'intl-tel-input/intlTelInputWithUtils'
5
- import 'intl-tel-input/build/js/utils.js'
4
+ import intlTelInput from 'intl-tel-input/build/js/intlTelInputWithUtils.js'
6
5
 
7
6
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
8
7
  import { globalProps } from '../utilities/globalProps'
@@ -214,16 +213,24 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
214
213
  // This also Fixes things for our react_component rendering on the Rails Side
215
214
  useEffect(formatAllCountries, [])
216
215
 
216
+ // If an initial country is not specified, the "globe" icon will show
217
+ // Always set a country
218
+ const fallbackCountry =
219
+ preferredCountries.length > 0 ? preferredCountries[0] :
220
+ onlyCountries.length > 0 ? onlyCountries.sort()[0] :
221
+ "af";
222
+
217
223
  useEffect(() => {
218
224
  const telInputInit = intlTelInput(inputRef.current, {
219
225
  separateDialCode: true,
220
226
  countryOrder: preferredCountries,
221
227
  allowDropdown: !disabled,
222
228
  autoInsertDialCode: false,
223
- initialCountry,
229
+ initialCountry: initialCountry || fallbackCountry,
224
230
  onlyCountries,
225
231
  countrySearch: false,
226
232
  fixDropdownWidth: false,
233
+ formatAsYouType: false,
227
234
  })
228
235
 
229
236
  inputRef.current.addEventListener("countrychange", (evt: Event) => {
@@ -1 +1 @@
1
- Preferred countries will display in the order they are listed with the first country preselected, and all non-preferred countries listed alphabetically below a section separator within the remaining dropdown.
1
+ Preferred countries will display in the order they are listed with the first country preselected, and all non-preferred countries listed alphabetically below in the remaining dropdown.
@@ -1,4 +1,6 @@
1
1
  /* @import "intl-tel-input/build/css/intlTelInput.css"; */
2
+ // Taken from 18.5.3, but with background-image replaced with PLAY-1527
3
+ // https://unpkg.com/browse/intl-tel-input@18.5.3/build/css/intlTelInput.css
2
4
  .iti {
3
5
  position: relative;
4
6
  display: inline-block;
@@ -1 +1,4 @@
1
- declare module 'intl-tel-input'
1
+ declare module 'intl-tel-input/build/js/intlTelInputWithUtils.js' {
2
+ const intlTelInput: any;
3
+ export default intlTelInput;
4
+ }