playbook_ui 14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4077 → 14.5.0.pre.alpha.PLAY1601updatereactzoompanpinch4128

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +20 -4
  3. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +45 -0
  4. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.md +1 -0
  5. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +1 -0
  6. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -0
  7. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
  8. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +2 -2
  9. data/app/pb_kits/playbook/pb_filter/Filter/ResultsCount.tsx +4 -2
  10. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +1 -1
  11. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +169 -65
  12. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.test.js +5 -5
  13. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +15 -9
  14. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_size.html.erb +336 -0
  15. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_size.jsx +97 -0
  16. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +2 -0
  17. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/index.js +1 -0
  18. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +28 -6
  19. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb +31 -1
  20. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +17 -71
  21. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +6 -15
  22. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_preferred_countries.md +1 -1
  23. data/app/pb_kits/playbook/pb_phone_number_input/intlTelInput.scss +931 -849
  24. data/app/pb_kits/playbook/pb_phone_number_input/types.d.ts +1 -4
  25. data/dist/chunks/{_typeahead-ICFw7Umq.js → _typeahead-C9g4qCcE.js} +1 -1
  26. data/dist/chunks/_weekday_stacked-BcMzYSwZ.js +45 -0
  27. data/dist/chunks/vendor.js +1 -1
  28. data/dist/playbook-doc.js +1 -1
  29. data/dist/playbook-rails-react-bindings.js +1 -1
  30. data/dist/playbook-rails.js +1 -1
  31. data/dist/playbook.css +1 -1
  32. data/lib/playbook/version.rb +1 -1
  33. metadata +8 -4
  34. data/dist/chunks/_weekday_stacked-BbASNHK_.js +0 -45
@@ -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,26 +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
- z-index: 2;
73
- top: 0;
74
- display: flex;
75
- height: 100%;
76
- justify-content: center;
77
- align-items: center;
78
- border-width: 0;
79
-
80
- padding: 0 $space_xxs 0 $space_xs;
32
+ .iti__selected-flag {
33
+ padding: 0 $space_xxs 0 $space_sm;
81
34
  border-radius: $space_xxs;
82
35
 
83
36
  &[aria-expanded="true"] {
@@ -98,24 +51,24 @@ $flag-min-resolution: 192dpi;
98
51
  }
99
52
  }
100
53
 
101
- .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 {
102
59
  background-color: $focus_input_light;
103
60
  }
104
61
 
105
62
  .iti__flag {
106
- 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");
107
64
  border-radius: 1px;
108
65
  }
109
66
 
110
- .iti__flag.iti__globe {
111
- background-image: url("https://unpkg.com/intl-tel-input@24.6.0/build/img/globe.png");
112
- background-position: center;
113
- height: 16px;
114
- width: 16px;
115
- background-size: 16px 16px;
67
+ .iti--separate-dial-code {
68
+ width: 100%;
116
69
  }
117
70
 
118
- .iti--show-flags .iti__selected-country {
71
+ .iti--separate-dial-code .iti__selected-flag {
119
72
  background-color: rgba($white, $opacity_1);
120
73
  }
121
74
 
@@ -183,13 +136,10 @@ $flag-min-resolution: 192dpi;
183
136
  .iti__dropdown-content {
184
137
  border-radius: $space_xs;
185
138
  border: 1px solid $border_light !important;
186
- position: absolute;
187
- z-index: 2;
188
- top: 100%;
189
139
  }
190
140
 
191
141
  &.dark {
192
- .iti--allow-dropdown .iti__country-container {
142
+ .iti--allow-dropdown .iti__flag-container {
193
143
  background-color: rgba($white, 0);
194
144
 
195
145
  &:hover {
@@ -199,13 +149,13 @@ $flag-min-resolution: 192dpi;
199
149
  background-color: rgba($white, 0.15);
200
150
  }
201
151
 
202
- .iti__selected-country {
152
+ .iti__selected-flag {
203
153
  background-color: rgba($white, 0);
204
154
  }
205
155
  }
206
156
  }
207
157
 
208
- .iti__selected-country {
158
+ .iti__selected-flag {
209
159
  background-color: rgba($white, 0);
210
160
  color: $white;
211
161
  }
@@ -246,15 +196,11 @@ $flag-min-resolution: 192dpi;
246
196
  background-color: rgba($white, 0.025) !important;
247
197
  }
248
198
  }
249
-
250
- .iti__selected-dial-code {
251
- color: $white;
252
- }
253
199
  }
254
-
200
+
255
201
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: $flag-min-resolution) {
256
202
  .iti__flag {
257
- 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");
258
204
  }
259
205
  }
260
206
  }
@@ -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.