playbook_ui 14.11.0 → 14.11.1.pre.alpha.PLAY1750pbcontenttagkitbutton5339
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +9 -11
- data/app/pb_kits/playbook/pb_badge/_badge.scss +2 -4
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +1 -3
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -3
- data/app/pb_kits/playbook/pb_button/button.html.erb +2 -3
- data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +1 -6
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +2 -4
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -6
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +1 -3
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +3 -5
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +4 -6
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +2 -4
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +8 -10
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +7 -12
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +9 -14
- data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +6 -11
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +8 -14
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +4 -6
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +1 -3
- data/app/pb_kits/playbook/pb_label_value/_label_value.scss +2 -4
- data/app/pb_kits/playbook/pb_message/_message_mixins.scss +1 -3
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +1 -3
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +3 -5
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +8 -10
- data/app/pb_kits/playbook/pb_pill/_pill.scss +2 -4
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +2 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +2 -4
- data/app/pb_kits/playbook/pb_select/_select.scss +3 -5
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +3 -5
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -3
- data/app/pb_kits/playbook/pb_textarea/_textarea.scss +1 -3
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +4 -5
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +2 -4
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +3 -5
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +3 -2
- data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +12 -4
- data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +5 -1
- data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.tsx +8 -3
- data/app/pb_kits/playbook/pb_typeahead/components/MenuList.tsx +6 -1
- data/app/pb_kits/playbook/pb_typeahead/components/Option.tsx +21 -6
- data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.tsx +13 -6
- data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +7 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +4 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_custom_options.jsx +5 -5
- data/dist/chunks/{_typeahead-C2iCBqxQ.js → _typeahead-BNULwihE.js} +1 -1
- data/dist/chunks/{_weekday_stacked-E-5KcEkc.js → _weekday_stacked-BKWemDAe.js} +1 -1
- data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
- 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/lib/playbook/version.rb +2 -2
- metadata +11 -9
- data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_table_props.md → _advanced_table_table_props_react.md} +0 -0
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "./intlTelInput";
|
4
2
|
@import "../tokens/colors";
|
5
3
|
|
@@ -41,7 +39,7 @@ $flag-min-resolution: 192dpi;
|
|
41
39
|
color: $charcoal;
|
42
40
|
}
|
43
41
|
|
44
|
-
// iti-spacer-horizontal's default is 8px, or $space_xs
|
42
|
+
// iti-spacer-horizontal's default is 8px, or $space_xs
|
45
43
|
.iti__country-list .iti__flag, .iti__country-name {
|
46
44
|
margin-right: $space_xs;
|
47
45
|
}
|
@@ -75,7 +73,7 @@ $flag-min-resolution: 192dpi;
|
|
75
73
|
}
|
76
74
|
|
77
75
|
.iti__divider {
|
78
|
-
border-bottom: 1px solid $border_light !important;
|
76
|
+
border-bottom: 1px solid $border_light !important;
|
79
77
|
}
|
80
78
|
|
81
79
|
.iti__selected-country-primary {
|
@@ -95,7 +93,7 @@ $flag-min-resolution: 192dpi;
|
|
95
93
|
justify-content: center;
|
96
94
|
align-items: center;
|
97
95
|
border-width: 0;
|
98
|
-
border-radius: $space_xxs;
|
96
|
+
border-radius: $space_xxs;
|
99
97
|
|
100
98
|
&[aria-expanded="true"] {
|
101
99
|
color: $primary_action;
|
@@ -165,7 +163,7 @@ $flag-min-resolution: 192dpi;
|
|
165
163
|
}
|
166
164
|
|
167
165
|
.iti__arrow.iti__arrow--up::before {
|
168
|
-
transform: rotate(-(
|
166
|
+
transform: rotate(-($transform-rotate-deg/3));
|
169
167
|
top: $space_xs + 4px;
|
170
168
|
color: $primary_action;
|
171
169
|
}
|
@@ -198,7 +196,7 @@ $flag-min-resolution: 192dpi;
|
|
198
196
|
}
|
199
197
|
|
200
198
|
.iti__dropdown-content {
|
201
|
-
border-radius: $space_xs;
|
199
|
+
border-radius: $space_xs;
|
202
200
|
border: 1px solid $border_light !important;
|
203
201
|
position: absolute;
|
204
202
|
top: 100%;
|
@@ -227,12 +225,12 @@ $flag-min-resolution: 192dpi;
|
|
227
225
|
}
|
228
226
|
|
229
227
|
.iti__dropdown-content {
|
230
|
-
border-radius: $space_xs;
|
228
|
+
border-radius: $space_xs;
|
231
229
|
border: 1px solid $border_dark !important;
|
232
230
|
}
|
233
231
|
|
234
232
|
.iti__divider {
|
235
|
-
border-bottom: 1px solid $border_dark !important;
|
233
|
+
border-bottom: 1px solid $border_dark !important;
|
236
234
|
}
|
237
235
|
|
238
236
|
.iti__country-list {
|
@@ -267,7 +265,7 @@ $flag-min-resolution: 192dpi;
|
|
267
265
|
color: $white;
|
268
266
|
}
|
269
267
|
}
|
270
|
-
|
268
|
+
|
271
269
|
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: $flag-min-resolution) {
|
272
270
|
.iti__flag {
|
273
271
|
background-image: url("https://unpkg.com/intl-tel-input@24.6.0/build/img/flags@2x.png");
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../tokens/spacing";
|
4
2
|
@import "../tokens/colors";
|
5
3
|
@import "../tokens/opacity";
|
@@ -11,9 +9,9 @@ $pb_pill_height: 22px;
|
|
11
9
|
display: inline-flex;
|
12
10
|
justify-content: center;
|
13
11
|
align-items: center;
|
14
|
-
padding: 0
|
12
|
+
padding: 0 $space-sm/1.8;
|
15
13
|
height: $pb_pill_height;
|
16
|
-
border-radius:
|
14
|
+
border-radius: $pb_pill_height/2;
|
17
15
|
white-space: nowrap;
|
18
16
|
|
19
17
|
&[class*=lowercase] {
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../tokens/colors";
|
4
2
|
@import "../tokens/opacity";
|
5
3
|
@import "../tokens/colors";
|
@@ -23,7 +21,7 @@ $pb_progress_simple_height: 4px;
|
|
23
21
|
[class^=pb_progress_simple_kit] {
|
24
22
|
width: 100%;
|
25
23
|
height: $pb_progress_simple_height;
|
26
|
-
border-radius:
|
24
|
+
border-radius: $pb_progress_simple_height/2;
|
27
25
|
background: rgba($primary, $opacity-1);
|
28
26
|
&[class*=_positive] {
|
29
27
|
.progress_simple_value {
|
@@ -44,7 +42,7 @@ $pb_progress_simple_height: 4px;
|
|
44
42
|
[class^=progress_simple_value] {
|
45
43
|
width: 0%;
|
46
44
|
height: 100%;
|
47
|
-
border-radius:
|
45
|
+
border-radius: $pb_progress_simple_height/2;
|
48
46
|
background: $primary;
|
49
47
|
}
|
50
48
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../pb_textarea/textarea_mixin";
|
4
2
|
@import "../pb_button/_button_mixins";
|
5
3
|
@import "../tokens/border_radius";
|
@@ -96,7 +94,7 @@
|
|
96
94
|
.trix-button--icon {
|
97
95
|
height: $space_lg;
|
98
96
|
width: $space_lg;
|
99
|
-
margin:
|
97
|
+
margin: $space_xs / 2;
|
100
98
|
border-radius: $border_rad_heavier;
|
101
99
|
&::before {
|
102
100
|
background-size: auto;
|
@@ -106,7 +104,7 @@
|
|
106
104
|
background: $white;
|
107
105
|
border: 1px solid #E4E8F0;
|
108
106
|
border-bottom: none;
|
109
|
-
padding:
|
107
|
+
padding: $space_xs / 2;
|
110
108
|
border-top-left-radius: $border_rad_heavier;
|
111
109
|
border-top-right-radius: $border_rad_heavier;
|
112
110
|
.trix-button-group {
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../pb_body/body_mixins";
|
4
2
|
@import "../pb_textarea/textarea_mixin";
|
5
3
|
@import "../tokens/titles";
|
@@ -83,7 +81,7 @@
|
|
83
81
|
display: block;
|
84
82
|
&.error {
|
85
83
|
[class*=pb_body_kit] {
|
86
|
-
margin-top:
|
84
|
+
margin-top: $space_xs / 2;
|
87
85
|
}
|
88
86
|
> select:first-child {
|
89
87
|
border-color: $error;
|
@@ -135,7 +133,7 @@
|
|
135
133
|
box-shadow: none;
|
136
134
|
border-color: transparent;
|
137
135
|
padding: 4px 8px;
|
138
|
-
padding-right: $space_lg;
|
136
|
+
padding-right: $space_lg;
|
139
137
|
border-radius: 4px;
|
140
138
|
option {
|
141
139
|
background-color: $white;
|
@@ -242,7 +240,7 @@
|
|
242
240
|
border-color: transparent;
|
243
241
|
background: transparent;
|
244
242
|
padding: 4px 8px;
|
245
|
-
padding-right: $space_lg;
|
243
|
+
padding-right: $space_lg;
|
246
244
|
border-radius: 4px;
|
247
245
|
option {
|
248
246
|
background-color: $white;
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../tokens/animation-curves";
|
4
2
|
@import "../tokens/colors";
|
5
3
|
@import "../tokens/opacity";
|
@@ -62,7 +60,7 @@ $pb_selectable_paddings: (
|
|
62
60
|
align-items: center;
|
63
61
|
height: $pb_selectable_card_indicator_size;
|
64
62
|
width: $pb_selectable_card_indicator_size;
|
65
|
-
border-radius:
|
63
|
+
border-radius: $pb_selectable_card_indicator_size/2 + $pb_selectable_card_border/2;
|
66
64
|
border-width: $pb_selectable_card_border;
|
67
65
|
border-style: solid;
|
68
66
|
border-color: $white;
|
@@ -71,8 +69,8 @@ $pb_selectable_paddings: (
|
|
71
69
|
font-size: $font_smaller;
|
72
70
|
text-align: center;
|
73
71
|
position: absolute;
|
74
|
-
top: -(
|
75
|
-
right: -(
|
72
|
+
top: -($pb_selectable_card_indicator_size/2);
|
73
|
+
right: -($pb_selectable_card_indicator_size/2);
|
76
74
|
opacity: 0;
|
77
75
|
}
|
78
76
|
}
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../pb_textarea/textarea_mixin";
|
4
2
|
@import "../tokens/titles";
|
5
3
|
@import "../tokens/colors";
|
@@ -102,7 +100,7 @@
|
|
102
100
|
&.error {
|
103
101
|
.text_input_wrapper {
|
104
102
|
[class*="pb_body_kit"] {
|
105
|
-
margin-top:
|
103
|
+
margin-top: $space_xs / 2;
|
106
104
|
}
|
107
105
|
input,
|
108
106
|
.text_input {
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../pb_body/body_mixins";
|
4
2
|
@import "./textarea_mixin";
|
5
3
|
@import "../tokens/spacing";
|
@@ -62,7 +60,7 @@
|
|
62
60
|
|
63
61
|
&.error {
|
64
62
|
[class*=pb_body_kit] {
|
65
|
-
margin-top:
|
63
|
+
margin-top: $space_xs / 2;
|
66
64
|
}
|
67
65
|
textarea {
|
68
66
|
border-color: $error;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
1
|
|
3
2
|
[class^=pb_time_range_inline_kit] {
|
4
3
|
&[class*=_center] {
|
@@ -23,14 +22,14 @@
|
|
23
22
|
display: flex;
|
24
23
|
align-items: center;
|
25
24
|
[class*=pb_time_range_inline_arrow] {
|
26
|
-
margin-left:
|
27
|
-
margin-right:
|
25
|
+
margin-left: $space_xs/2;
|
26
|
+
margin-right: $space_xs/2;
|
28
27
|
}
|
29
28
|
[class*=pb_time_range_inline_timezone] {
|
30
|
-
margin-left:
|
29
|
+
margin-left: $space_xs/2;
|
31
30
|
}
|
32
31
|
[class*=pb_time_range_inline_icon] {
|
33
|
-
margin-right:
|
32
|
+
margin-right: $space_xs/2;
|
34
33
|
}
|
35
34
|
}
|
36
35
|
}
|
@@ -1,14 +1,12 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../tokens/colors";
|
4
2
|
@import "../tokens/spacing";
|
5
3
|
@import "../tokens/opacity";
|
6
4
|
@import "../tokens/typography";
|
7
5
|
|
8
6
|
$connector_width: 2px;
|
9
|
-
$icon_margin:
|
7
|
+
$icon_margin: $space_xs/2;
|
10
8
|
$icon_height: 28px;
|
11
|
-
$height_from_top:
|
9
|
+
$height_from_top: $icon_height/2 - $connector_width/2;
|
12
10
|
|
13
11
|
// Add gap variables
|
14
12
|
$gap_xs: $height_from_top + $space_xs;
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../tokens/colors";
|
4
2
|
|
5
3
|
$color_checkbox_success: $data_1;
|
@@ -10,7 +8,7 @@ $transition: .2s ease-in-out;
|
|
10
8
|
[class^=pb_toggle_kit] {
|
11
9
|
position: relative;
|
12
10
|
$width: 44px;
|
13
|
-
$height:
|
11
|
+
$height: $width / 2;
|
14
12
|
$border_success: 3px solid $color_checkbox_success;
|
15
13
|
$border_default: 3px solid $color_checkbox_default;
|
16
14
|
|
@@ -29,7 +27,7 @@ $transition: .2s ease-in-out;
|
|
29
27
|
&:after {
|
30
28
|
transition: $transition;
|
31
29
|
content: "";
|
32
|
-
width:
|
30
|
+
width: $width / 2 - 4px;
|
33
31
|
height: $height - 4px;
|
34
32
|
background-color: $color_checkbox_default;
|
35
33
|
border-radius: 50%;
|
@@ -70,7 +68,7 @@ $transition: .2s ease-in-out;
|
|
70
68
|
background-color: $color_checkbox_success;
|
71
69
|
|
72
70
|
&:after {
|
73
|
-
left:
|
71
|
+
left: $width / 2 + 2px;
|
74
72
|
background-color: $white;
|
75
73
|
}
|
76
74
|
}
|
@@ -42,8 +42,8 @@ type TypeaheadProps = {
|
|
42
42
|
id?: string,
|
43
43
|
label?: string,
|
44
44
|
loadOptions?: string | Noop,
|
45
|
-
getOptionLabel?: string | (() =>
|
46
|
-
getOptionValue?: string | (() =>
|
45
|
+
getOptionLabel?: string | (() => string),
|
46
|
+
getOptionValue?: string | (() => string),
|
47
47
|
name?: string,
|
48
48
|
marginBottom?: "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
|
49
49
|
pillColor?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
|
@@ -109,6 +109,7 @@ const Typeahead = ({
|
|
109
109
|
multiKit: '',
|
110
110
|
onCreateOption: null as null,
|
111
111
|
plusIcon: false,
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
112
113
|
onMultiValueClick: (_option: SelectValueType): any => undefined,
|
113
114
|
pillColor: pillColor,
|
114
115
|
...props,
|
@@ -1,16 +1,24 @@
|
|
1
1
|
import React, { useEffect } from 'react'
|
2
2
|
import { components } from 'react-select'
|
3
3
|
|
4
|
-
|
4
|
+
type ClearContainerProps = {
|
5
|
+
children: React.ReactNode,
|
6
|
+
selectProps?: {
|
7
|
+
id: string,
|
8
|
+
},
|
9
|
+
clearValue: () => void,
|
10
|
+
}
|
11
|
+
|
12
|
+
const ClearContainer = (props: ClearContainerProps): React.ReactElement => {
|
5
13
|
const { selectProps, clearValue } = props
|
6
14
|
useEffect(() => {
|
7
15
|
document.addEventListener(`pb-typeahead-kit-${selectProps.id}:clear`, clearValue)
|
8
|
-
}, [
|
16
|
+
}, [clearValue, selectProps.id])
|
9
17
|
|
10
18
|
return (
|
11
19
|
<components.ClearIndicator
|
12
|
-
|
13
|
-
|
20
|
+
className="clear_indicator"
|
21
|
+
{...props}
|
14
22
|
/>
|
15
23
|
)
|
16
24
|
}
|
@@ -5,7 +5,11 @@ import Flex from '../../pb_flex/_flex'
|
|
5
5
|
import TextInput from '../../pb_text_input/_text_input'
|
6
6
|
|
7
7
|
type Props = {
|
8
|
-
|
8
|
+
selectProps: {
|
9
|
+
dark?: boolean,
|
10
|
+
label: string,
|
11
|
+
error?: string,
|
12
|
+
},
|
9
13
|
}
|
10
14
|
|
11
15
|
const TypeaheadControl = (props: Props) => (
|
@@ -1,10 +1,15 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { components } from 'react-select'
|
3
3
|
|
4
|
-
|
4
|
+
type IndicatorsContainerProps = {
|
5
|
+
children: React.ReactNode,
|
6
|
+
}
|
7
|
+
|
8
|
+
|
9
|
+
const IndicatorsContainer = (props: IndicatorsContainerProps): React.ReactElement => (
|
5
10
|
<components.IndicatorsContainer
|
6
|
-
|
7
|
-
|
11
|
+
className="text_input_indicators"
|
12
|
+
{...props}
|
8
13
|
/>
|
9
14
|
)
|
10
15
|
|
@@ -1,7 +1,12 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { components } from 'react-select'
|
3
3
|
|
4
|
-
|
4
|
+
type MenuListProps = {
|
5
|
+
children: React.ReactNode,
|
6
|
+
footer: React.ReactNode,
|
7
|
+
}
|
8
|
+
|
9
|
+
const MenuList = (props: MenuListProps): React.ReactElement => {
|
5
10
|
return (
|
6
11
|
<components.MenuList {...props}>
|
7
12
|
{props.children}
|
@@ -3,7 +3,22 @@ import { components } from 'react-select'
|
|
3
3
|
|
4
4
|
import User from '../../pb_user/_user'
|
5
5
|
|
6
|
-
|
6
|
+
type OptionProps = {
|
7
|
+
children: React.ReactNode,
|
8
|
+
label?: string,
|
9
|
+
data: {
|
10
|
+
imageUrl?: string,
|
11
|
+
},
|
12
|
+
selectProps: {
|
13
|
+
dark?: boolean,
|
14
|
+
valueComponent?: (data: {
|
15
|
+
imageUrl?: string,
|
16
|
+
}) => React.ReactNode,
|
17
|
+
},
|
18
|
+
}
|
19
|
+
|
20
|
+
|
21
|
+
const Option = (props: OptionProps): React.ReactElement => {
|
7
22
|
const {
|
8
23
|
imageUrl,
|
9
24
|
} = props.data
|
@@ -14,11 +29,11 @@ const Option = (props: any) => {
|
|
14
29
|
<>
|
15
30
|
{!valueComponent && imageUrl &&
|
16
31
|
<User
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
32
|
+
align="left"
|
33
|
+
avatarUrl={imageUrl}
|
34
|
+
dark={props.selectProps.dark}
|
35
|
+
name={props.label}
|
36
|
+
orientation="horizontal"
|
22
37
|
/>
|
23
38
|
}
|
24
39
|
|
@@ -4,19 +4,26 @@ import { components } from 'react-select'
|
|
4
4
|
import Flex from '../../pb_flex/_flex'
|
5
5
|
import Icon from '../../pb_icon/_icon'
|
6
6
|
|
7
|
-
|
7
|
+
type PlaceholderProps = {
|
8
|
+
children: React.ReactNode,
|
9
|
+
selectProps: {
|
10
|
+
plusIcon?: boolean,
|
11
|
+
},
|
12
|
+
}
|
13
|
+
|
14
|
+
const Placeholder = (props: PlaceholderProps): React.ReactElement => (
|
8
15
|
<>
|
9
16
|
<Flex
|
10
|
-
|
11
|
-
|
17
|
+
align="center"
|
18
|
+
className="placeholder"
|
12
19
|
>
|
13
20
|
<components.IndicatorsContainer
|
14
|
-
|
21
|
+
{...props}
|
15
22
|
/>
|
16
23
|
{props.selectProps.plusIcon &&
|
17
24
|
<Icon
|
18
|
-
|
19
|
-
|
25
|
+
className="typeahead-plus-icon"
|
26
|
+
icon="plus"
|
20
27
|
/>
|
21
28
|
}
|
22
29
|
</Flex>
|
@@ -1,10 +1,14 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { components } from 'react-select'
|
3
3
|
|
4
|
-
|
4
|
+
type ValueContainerProps = {
|
5
|
+
children: React.ReactNode,
|
6
|
+
}
|
7
|
+
|
8
|
+
const ValueContainer = (props: ValueContainerProps): React.ReactElement => (
|
5
9
|
<components.ValueContainer
|
6
|
-
|
7
|
-
|
10
|
+
className="text_input_value_container"
|
11
|
+
{...props}
|
8
12
|
/>
|
9
13
|
)
|
10
14
|
|
@@ -45,8 +45,7 @@ const promiseOptions = (inputValue) =>
|
|
45
45
|
|
46
46
|
const TypeaheadWithPillsAsync = (props) => {
|
47
47
|
const [users, setUsers] = useState([])
|
48
|
-
|
49
|
-
const formatValue = (users) => formatUsers(users)
|
48
|
+
|
50
49
|
const formatUsers = (users) => {
|
51
50
|
const results = () => (users.map((user) => {
|
52
51
|
if (Object.keys(user)[0] === 'name' || Object.keys(user)[1] === 'id'){
|
@@ -58,6 +57,9 @@ const TypeaheadWithPillsAsync = (props) => {
|
|
58
57
|
return results()
|
59
58
|
}
|
60
59
|
|
60
|
+
const handleOnChange = (value) => setUsers(formatUsers(value))
|
61
|
+
const formatValue = (users) => formatUsers(users)
|
62
|
+
|
61
63
|
return (
|
62
64
|
<>
|
63
65
|
{users && users.length > 0 && (
|
@@ -83,13 +83,13 @@ const TypeaheadWithPillsAsyncCustomOptions = (props) => {
|
|
83
83
|
onChange={handleOnChange}
|
84
84
|
onMultiValueClick={handleOnMultiValueClick}
|
85
85
|
placeholder="type the name of a Github user"
|
86
|
-
valueComponent={(
|
86
|
+
valueComponent={({imageUrl, label, territory, type}) => (
|
87
87
|
<User
|
88
88
|
avatar
|
89
|
-
avatarUrl={
|
90
|
-
name={
|
91
|
-
territory={
|
92
|
-
title={
|
89
|
+
avatarUrl={imageUrl}
|
90
|
+
name={label}
|
91
|
+
territory={territory}
|
92
|
+
title={type}
|
93
93
|
/>
|
94
94
|
)}
|
95
95
|
{...props}
|