playbook_ui 14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4162 → 14.5.0.pre.alpha.PLAY1601updatereactzoompanpinch4123
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_phone_number_input/_phone_number_input.scss +17 -81
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +6 -15
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_preferred_countries.md +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/intlTelInput.scss +931 -849
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +1 -2
- data/app/pb_kits/playbook/pb_phone_number_input/types.d.ts +1 -4
- data/dist/chunks/{_typeahead-ICFw7Umq.js → _typeahead-C9g4qCcE.js} +1 -1
- data/dist/chunks/{_weekday_stacked-CDe9cyw6.js → _weekday_stacked-DZpRml83.js} +2 -2
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eef39be443e3cd1b5d31fbf6c45383f7efbcdd3f41194ba4a977c21700bd862
|
4
|
+
data.tar.gz: 47fb682efcfea59eb34f2fcdcb3f15e52a254ee12d7c9974d18fbe2a411ca6b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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-
|
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-
|
62
|
-
|
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
|
-
.
|
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/
|
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
|
-
.
|
110
|
-
|
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--
|
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 .
|
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-
|
152
|
+
.iti__selected-flag {
|
201
153
|
background-color: rgba($white, 0);
|
202
154
|
}
|
203
155
|
}
|
204
156
|
}
|
205
157
|
|
206
|
-
.iti__selected-
|
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/
|
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
|
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 =
|
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
|
-
|
220
|
+
preferredCountries,
|
227
221
|
allowDropdown: !disabled,
|
228
222
|
autoInsertDialCode: false,
|
229
|
-
initialCountry
|
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) => {
|
data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_preferred_countries.md
CHANGED
@@ -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
|
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.
|