playbook_ui 14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4162 → 14.5.0.pre.alpha.PLAY1601updatereactzoompanpinch4123

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f54238916554d7fc5db336d5fd9f600012d2d3451b1232364a9a6f70276f6241
4
- data.tar.gz: 2081782f7da94b64103e5a4beeb61a34c3fd1d3c9e4d99979388d4042ec5edae
3
+ metadata.gz: 3eef39be443e3cd1b5d31fbf6c45383f7efbcdd3f41194ba4a977c21700bd862
4
+ data.tar.gz: 47fb682efcfea59eb34f2fcdcb3f15e52a254ee12d7c9974d18fbe2a411ca6b0
5
5
  SHA512:
6
- metadata.gz: c6fffc6c90ba549db56e62d9db74f412ad6d86a52b6ff9dfd1329c33a385226086d547cdbc046555c908cb408c2d262c33b541c63d4e3193bc961bed58475c72
7
- data.tar.gz: 2e8ffc641e46dd560aeb456042d3f437a152e4341836f2d5ffdf87872264663076c1d0d4f6d8e30ebe80f346aca768764cbb5d57b4280137a63a9b182d5ca019
6
+ metadata.gz: 80c6b66534b581c9c5bf5494928b003eeac846f2346fd9a7a394361abe00fdcfe616f8772df66edbbf8a9cb01f9bfddd6c23ac81ff19df22bd96de4fb5e71de9
7
+ data.tar.gz: 2698718348044f92ad1589b367d5c51d36a7c371f717855b9da6b4b45caab620291ffa0253c98090dd1b731709286498a6a9c274b1ced957f0d76b5b76a7f1d4
@@ -6,35 +6,6 @@ $dropdown-min-width: 340px;
6
6
  $flag-min-resolution: 192dpi;
7
7
 
8
8
  .pb_phone_number_input {
9
- .iti {
10
- width: 100%;
11
- }
12
-
13
- .iti__flag {
14
- margin-right: 6px;
15
- }
16
-
17
- .iti__a11y-text {
18
- display: none;
19
- }
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
-
33
- .iti--allow-dropdown .iti__country-container:not(:has(+ input[disabled])):not(:has(+ input[readonly])) .iti__selected-country-primary:hover,
34
- .iti--allow-dropdown .iti__country-container:not(:has(+ input[disabled])):not(:has(+ input[readonly])) .iti__selected-country:has(+ .iti__dropdown-content:hover) .iti__selected-country-primary {
35
- background-color: transparent;
36
- }
37
-
38
9
  input::placeholder {
39
10
  color: $focus_input_light;
40
11
  }
@@ -44,7 +15,7 @@ $flag-min-resolution: 192dpi;
44
15
  border-color: $primary !important;
45
16
  }
46
17
 
47
- .iti__selected-country:focus-visible {
18
+ .iti__selected-flag:focus-visible {
48
19
  outline-style: none;
49
20
  }
50
21
  }
@@ -58,25 +29,8 @@ $flag-min-resolution: 192dpi;
58
29
  border-bottom: 1px solid $border_light !important;
59
30
  }
60
31
 
61
- .iti__selected-country-primary {
62
- display: flex;
63
- justify-content: center;
64
- align-items: center;
65
- .iti__flag {
66
- margin-right: 0;
67
- }
68
- }
69
-
70
- .iti__selected-country {
71
- position: absolute;
72
- top: 0;
73
- display: flex;
74
- height: 100%;
75
- justify-content: center;
76
- align-items: center;
77
- border-width: 0;
78
-
79
- padding: 0 $space_xxs 0 $space_xs;
32
+ .iti__selected-flag {
33
+ padding: 0 $space_xxs 0 $space_sm;
80
34
  border-radius: $space_xxs;
81
35
 
82
36
  &[aria-expanded="true"] {
@@ -97,24 +51,24 @@ $flag-min-resolution: 192dpi;
97
51
  }
98
52
  }
99
53
 
100
- .iti__country-container:hover + .text_input {
54
+ .iti--allow-dropdown .iti__flag-container:hover .iti__selected-flag {
55
+ background-color: $focus_input_light;
56
+ }
57
+
58
+ .iti__flag-container:hover + .text_input {
101
59
  background-color: $focus_input_light;
102
60
  }
103
61
 
104
62
  .iti__flag {
105
- background-image: url("https://unpkg.com/intl-tel-input@24.6.0/build/img/flags.png");
63
+ background-image: url("https://unpkg.com/playbook-ui@14.2.0-alpha.fixphonenumberinputflag3631/dist/assets/flags.png");
106
64
  border-radius: 1px;
107
65
  }
108
66
 
109
- .iti__flag.iti__globe {
110
- background-image: url("https://unpkg.com/intl-tel-input@24.6.0/build/img/globe.png");
111
- background-position: center;
112
- height: 16px;
113
- width: 16px;
114
- background-size: 16px 16px;
67
+ .iti--separate-dial-code {
68
+ width: 100%;
115
69
  }
116
70
 
117
- .iti--show-flags .iti__selected-country {
71
+ .iti--separate-dial-code .iti__selected-flag {
118
72
  background-color: rgba($white, $opacity_1);
119
73
  }
120
74
 
@@ -182,12 +136,10 @@ $flag-min-resolution: 192dpi;
182
136
  .iti__dropdown-content {
183
137
  border-radius: $space_xs;
184
138
  border: 1px solid $border_light !important;
185
- position: absolute;
186
- top: 100%;
187
139
  }
188
140
 
189
141
  &.dark {
190
- .iti--allow-dropdown .iti__country-container {
142
+ .iti--allow-dropdown .iti__flag-container {
191
143
  background-color: rgba($white, 0);
192
144
 
193
145
  &:hover {
@@ -197,13 +149,13 @@ $flag-min-resolution: 192dpi;
197
149
  background-color: rgba($white, 0.15);
198
150
  }
199
151
 
200
- .iti__selected-country {
152
+ .iti__selected-flag {
201
153
  background-color: rgba($white, 0);
202
154
  }
203
155
  }
204
156
  }
205
157
 
206
- .iti__selected-country {
158
+ .iti__selected-flag {
207
159
  background-color: rgba($white, 0);
208
160
  color: $white;
209
161
  }
@@ -244,27 +196,11 @@ $flag-min-resolution: 192dpi;
244
196
  background-color: rgba($white, 0.025) !important;
245
197
  }
246
198
  }
247
-
248
- .iti__selected-dial-code {
249
- color: $white;
250
- }
251
199
  }
252
-
200
+
253
201
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: $flag-min-resolution) {
254
202
  .iti__flag {
255
- background-image: url("https://unpkg.com/intl-tel-input@24.6.0/build/img/flags@2x.png");
203
+ background-image: url("https://unpkg.com/playbook-ui@14.2.0-alpha.fixphonenumberinputflag3631/dist/assets/flags.png");
256
204
  }
257
205
  }
258
206
  }
259
-
260
- // Rails Phone Number Input padding placement of placeholders
261
- // is off in a Dialog because it doesn't account for
262
- // padding: 0 $space_xxs 0 $space_xs;
263
- // Set to 0 so the placeholder doesn't overlap with selected country
264
- .pb_dialog {
265
- .pb_phone_number_input_rails {
266
- .iti__selected-country {
267
- padding: 0;
268
- }
269
- }
270
- }
@@ -1,7 +1,8 @@
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/build/js/intlTelInputWithUtils.js'
4
+ import intlTelInput from 'intl-tel-input'
5
+ import 'intl-tel-input/build/js/utils.js'
5
6
 
6
7
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
7
8
  import { globalProps } from '../utilities/globalProps'
@@ -49,7 +50,7 @@ const formatToGlobalCountryName = (countryName: string) => {
49
50
  }
50
51
 
51
52
  const formatAllCountries = () => {
52
- const countryData = intlTelInput.getCountryData()
53
+ const countryData = window.intlTelInputGlobals.getCountryData()
53
54
 
54
55
  for (let i = 0; i < countryData.length; i++) {
55
56
  const country = countryData[i]
@@ -213,24 +214,14 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
213
214
  // This also Fixes things for our react_component rendering on the Rails Side
214
215
  useEffect(formatAllCountries, [])
215
216
 
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
-
223
217
  useEffect(() => {
224
218
  const telInputInit = intlTelInput(inputRef.current, {
225
219
  separateDialCode: true,
226
- countryOrder: preferredCountries,
220
+ preferredCountries,
227
221
  allowDropdown: !disabled,
228
222
  autoInsertDialCode: false,
229
- initialCountry: initialCountry || fallbackCountry,
230
- onlyCountries,
231
- countrySearch: false,
232
- fixDropdownWidth: false,
233
- formatAsYouType: false,
223
+ initialCountry,
224
+ onlyCountries
234
225
  })
235
226
 
236
227
  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 in 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 a section separator within the remaining dropdown.