playbook_ui 14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5315 → 14.10.0.pre.alpha.play1465attempt25272
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/_playbook.scss +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/index.js +8 -53
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +18 -23
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -6
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +4 -6
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +15 -24
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx +1 -3
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx +1 -4
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_max_size.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table.tsx +1 -8
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +0 -18
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +1 -22
- data/app/pb_kits/playbook/pb_text_input/text_input.test.js +0 -80
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +30 -30
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +5 -5
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.html.erb +5 -4
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.jsx +4 -4
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.md +1 -1
- data/app/pb_kits/playbook/pb_timeline/timeline.rb +6 -6
- 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/app/pb_kits/playbook/utilities/globalPropNames.mjs +0 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +9 -18
- data/dist/chunks/_typeahead-BhT5aXCY.js +22 -0
- data/dist/chunks/_weekday_stacked-DJOTNDSY.js +45 -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/dist/playbook.css +1 -1
- data/lib/playbook/classnames.rb +0 -1
- data/lib/playbook/spacing.rb +0 -21
- data/lib/playbook/version.rb +1 -1
- metadata +4 -5
- data/app/pb_kits/playbook/utilities/_gap.scss +0 -29
- data/dist/chunks/_typeahead-C2iCBqxQ.js +0 -36
- data/dist/chunks/_weekday_stacked-CWnbnW7m.js +0 -45
@@ -50,7 +50,7 @@ $gap_lg: $height_from_top + $space_lg;
|
|
50
50
|
>div {
|
51
51
|
&:last-child {
|
52
52
|
flex-basis: auto !important;
|
53
|
-
[class
|
53
|
+
[class=pb_timeline_item_step] {
|
54
54
|
[class=pb_timeline_item_connector] {
|
55
55
|
opacity: 0;
|
56
56
|
}
|
@@ -66,25 +66,29 @@ $gap_lg: $height_from_top + $space_lg;
|
|
66
66
|
[class*=pb_timeline_item_kit] {
|
67
67
|
&[class*=_solid] {
|
68
68
|
flex-basis: 100%;
|
69
|
-
[class
|
69
|
+
[class=pb_timeline_item_left_block] {
|
70
|
+
height: 0px;
|
71
|
+
}
|
72
|
+
[class=pb_timeline_item_step] {
|
70
73
|
@include flex_wrapper(row);
|
71
|
-
align-items: center;
|
72
74
|
margin-top: $space_xs;
|
73
75
|
margin-bottom: $space_xs;
|
74
76
|
[class=pb_timeline_item_connector] {
|
75
|
-
@include pb_timeline_line_solid($connector_width, $connector_width,
|
77
|
+
@include pb_timeline_line_solid($connector_width, $connector_width, $height_from_top $icon_margin 0 $icon_margin );
|
76
78
|
}
|
77
79
|
}
|
78
80
|
}
|
79
81
|
&[class*=_dotted] {
|
80
82
|
flex-basis: 100%;
|
81
|
-
[class
|
83
|
+
[class=pb_timeline_item_left_block] {
|
84
|
+
height: 0;
|
85
|
+
}
|
86
|
+
[class=pb_timeline_item_step] {
|
82
87
|
@include flex_wrapper(row);
|
83
|
-
align-items: center;
|
84
88
|
margin-top: $space_xs;
|
85
89
|
margin-bottom: $space_xs;
|
86
90
|
[class=pb_timeline_item_connector] {
|
87
|
-
@include pb_timeline_line_dotted_horizontal($connector_width, $connector_width,
|
91
|
+
@include pb_timeline_line_dotted_horizontal($connector_width, $connector_width, $height_from_top $icon_margin 0 $icon_margin );
|
88
92
|
}
|
89
93
|
}
|
90
94
|
}
|
@@ -95,7 +99,7 @@ $gap_lg: $height_from_top + $space_lg;
|
|
95
99
|
>div {
|
96
100
|
&:last-child {
|
97
101
|
flex-basis: auto !important;
|
98
|
-
[class
|
102
|
+
[class=pb_timeline_item_step] {
|
99
103
|
[class=pb_timeline_item_connector] {
|
100
104
|
opacity: 0;
|
101
105
|
}
|
@@ -125,12 +129,12 @@ $gap_lg: $height_from_top + $space_lg;
|
|
125
129
|
}
|
126
130
|
}
|
127
131
|
}
|
128
|
-
[class
|
132
|
+
[class=pb_timeline_item_step] {
|
129
133
|
@include flex_wrapper(row);
|
130
134
|
margin-top: $space_xs;
|
131
135
|
margin-bottom: $space_xs;
|
132
136
|
[class=pb_timeline_item_connector] {
|
133
|
-
@include pb_timeline_line_solid($connector_width, $connector_width,
|
137
|
+
@include pb_timeline_line_solid($connector_width, $connector_width, $height_from_top $icon_margin 0 $icon_margin );
|
134
138
|
}
|
135
139
|
}
|
136
140
|
}
|
@@ -149,12 +153,12 @@ $gap_lg: $height_from_top + $space_lg;
|
|
149
153
|
}
|
150
154
|
}
|
151
155
|
}
|
152
|
-
[class
|
156
|
+
[class=pb_timeline_item_step] {
|
153
157
|
@include flex_wrapper(row);
|
154
158
|
margin-top: $space_xs;
|
155
159
|
margin-bottom: $space_xs;
|
156
160
|
[class=pb_timeline_item_connector] {
|
157
|
-
@include pb_timeline_line_dotted_horizontal($connector_width, $connector_width,
|
161
|
+
@include pb_timeline_line_dotted_horizontal($connector_width, $connector_width, $height_from_top $icon_margin 0 $icon_margin );
|
158
162
|
}
|
159
163
|
}
|
160
164
|
}
|
@@ -166,7 +170,7 @@ $gap_lg: $height_from_top + $space_lg;
|
|
166
170
|
align-items: flex-start;
|
167
171
|
align-self: auto;
|
168
172
|
>div:last-child {
|
169
|
-
[class
|
173
|
+
[class=pb_timeline_item_step] {
|
170
174
|
[class=pb_timeline_item_connector] {
|
171
175
|
opacity: 0;
|
172
176
|
}
|
@@ -176,14 +180,13 @@ $gap_lg: $height_from_top + $space_lg;
|
|
176
180
|
@include flex_wrapper(row);
|
177
181
|
&[class*=_solid] {
|
178
182
|
flex-basis: 100%;
|
179
|
-
[class
|
183
|
+
[class=pb_timeline_item_step] {
|
180
184
|
@include flex_wrapper(column);
|
181
|
-
align-items: center;
|
182
185
|
align-content: flex-start;
|
183
186
|
margin-right: $space_sm;
|
184
187
|
margin-left: $space_sm;
|
185
188
|
[class=pb_timeline_item_connector] {
|
186
|
-
@include pb_timeline_line_solid($connector_width, $connector_width, $icon_margin 0 $icon_margin
|
189
|
+
@include pb_timeline_line_solid($connector_width, $connector_width, $icon_margin 0 $icon_margin $height_from_top);
|
187
190
|
}
|
188
191
|
}
|
189
192
|
[class=pb_timeline_item_left_block] {
|
@@ -197,13 +200,12 @@ $gap_lg: $height_from_top + $space_lg;
|
|
197
200
|
}
|
198
201
|
&[class*=_dotted] {
|
199
202
|
flex-basis: 100%;
|
200
|
-
[class
|
203
|
+
[class=pb_timeline_item_step] {
|
201
204
|
@include flex_wrapper(column);
|
202
|
-
align-items: center;
|
203
205
|
margin-right: $space_sm;
|
204
206
|
margin-left: $space_sm;
|
205
207
|
[class=pb_timeline_item_connector] {
|
206
|
-
@include pb_timeline_line_dotted_vertical($connector_width, $connector_width, $icon_margin 0 $icon_margin
|
208
|
+
@include pb_timeline_line_dotted_vertical($connector_width, $connector_width, $icon_margin 0 $icon_margin $height_from_top);
|
207
209
|
}
|
208
210
|
}
|
209
211
|
[class=pb_timeline_item_left_block] {
|
@@ -221,7 +223,7 @@ $gap_lg: $height_from_top + $space_lg;
|
|
221
223
|
align-items: flex-start;
|
222
224
|
align-self: auto;
|
223
225
|
>div:last-child {
|
224
|
-
[class
|
226
|
+
[class=pb_timeline_item_step] {
|
225
227
|
[class=pb_timeline_item_connector] {
|
226
228
|
opacity: 0;
|
227
229
|
}
|
@@ -231,14 +233,13 @@ $gap_lg: $height_from_top + $space_lg;
|
|
231
233
|
@include flex_wrapper(row);
|
232
234
|
&[class*=_solid] {
|
233
235
|
flex-basis: 100%;
|
234
|
-
[class
|
236
|
+
[class=pb_timeline_item_step] {
|
235
237
|
@include flex_wrapper(column);
|
236
|
-
align-items: center;
|
237
238
|
align-content: flex-start;
|
238
239
|
margin-right: $space_sm;
|
239
240
|
margin-left: $space_sm;
|
240
241
|
[class=pb_timeline_item_connector] {
|
241
|
-
@include pb_timeline_line_solid($connector_width, $connector_width, $icon_margin 0 $icon_margin
|
242
|
+
@include pb_timeline_line_solid($connector_width, $connector_width, $icon_margin 0 $icon_margin $height_from_top);
|
242
243
|
}
|
243
244
|
}
|
244
245
|
[class=pb_timeline_item_left_block] {
|
@@ -252,13 +253,12 @@ $gap_lg: $height_from_top + $space_lg;
|
|
252
253
|
}
|
253
254
|
&[class*=_dotted] {
|
254
255
|
flex-basis: 100%;
|
255
|
-
[class
|
256
|
+
[class=pb_timeline_item_step] {
|
256
257
|
@include flex_wrapper(column);
|
257
|
-
align-items: center;
|
258
258
|
margin-right: $space_sm;
|
259
259
|
margin-left: $space_sm;
|
260
260
|
[class=pb_timeline_item_connector] {
|
261
|
-
@include pb_timeline_line_dotted_vertical($connector_width, $connector_width, $icon_margin 0 $icon_margin
|
261
|
+
@include pb_timeline_line_dotted_vertical($connector_width, $connector_width, $icon_margin 0 $icon_margin $height_from_top);
|
262
262
|
}
|
263
263
|
}
|
264
264
|
[class=pb_timeline_item_left_block] {
|
@@ -274,7 +274,7 @@ $gap_lg: $height_from_top + $space_lg;
|
|
274
274
|
}
|
275
275
|
&[class*=_gap_xs] {
|
276
276
|
[class*=pb_timeline_item_kit] {
|
277
|
-
[class
|
277
|
+
[class=pb_timeline_item_step] {
|
278
278
|
[class=pb_timeline_item_connector] {
|
279
279
|
height: $gap_xs !important;
|
280
280
|
}
|
@@ -283,7 +283,7 @@ $gap_lg: $height_from_top + $space_lg;
|
|
283
283
|
}
|
284
284
|
&[class*=_gap_sm] {
|
285
285
|
[class*=pb_timeline_item_kit] {
|
286
|
-
[class
|
286
|
+
[class=pb_timeline_item_step] {
|
287
287
|
[class=pb_timeline_item_connector] {
|
288
288
|
height: $gap_sm !important;
|
289
289
|
}
|
@@ -292,7 +292,7 @@ $gap_lg: $height_from_top + $space_lg;
|
|
292
292
|
}
|
293
293
|
&[class*=_gap_md] {
|
294
294
|
[class*=pb_timeline_item_kit] {
|
295
|
-
[class
|
295
|
+
[class=pb_timeline_item_step] {
|
296
296
|
[class=pb_timeline_item_connector] {
|
297
297
|
height: $gap_md !important;
|
298
298
|
}
|
@@ -301,7 +301,7 @@ $gap_lg: $height_from_top + $space_lg;
|
|
301
301
|
}
|
302
302
|
&[class*=_gap_lg] {
|
303
303
|
[class*=pb_timeline_item_kit] {
|
304
|
-
[class
|
304
|
+
[class=pb_timeline_item_step] {
|
305
305
|
[class=pb_timeline_item_connector] {
|
306
306
|
height: $gap_lg !important;
|
307
307
|
}
|
@@ -20,7 +20,7 @@ type TimelineProps = {
|
|
20
20
|
id?: string,
|
21
21
|
orientation?: string,
|
22
22
|
showDate?: boolean,
|
23
|
-
|
23
|
+
gap?: 'xs' | 'sm' | 'md' | 'lg' | 'none',
|
24
24
|
} & GlobalProps
|
25
25
|
|
26
26
|
const Timeline = ({
|
@@ -32,15 +32,15 @@ const Timeline = ({
|
|
32
32
|
id,
|
33
33
|
orientation = 'horizontal',
|
34
34
|
showDate = false,
|
35
|
-
|
35
|
+
gap = 'none',
|
36
36
|
...props
|
37
37
|
}: TimelineProps): React.ReactElement => {
|
38
38
|
const ariaProps = buildAriaProps(aria)
|
39
39
|
const dataProps = buildDataProps(data)
|
40
40
|
const htmlProps = buildHtmlProps(htmlOptions)
|
41
41
|
const dateStyle = showDate === true ? '_with_date' : ''
|
42
|
-
const
|
43
|
-
const timelineCss = buildCss('pb_timeline_kit', `${orientation}`, dateStyle,
|
42
|
+
const gapStyle = gap === 'none' ? '' : `gap_${gap}`
|
43
|
+
const timelineCss = buildCss('pb_timeline_kit', `${orientation}`, dateStyle, gapStyle)
|
44
44
|
|
45
45
|
return (
|
46
46
|
<div
|
@@ -60,4 +60,4 @@ Timeline.Step = TimelineStep
|
|
60
60
|
Timeline.Label = TimelineLabel
|
61
61
|
Timeline.Detail = TimelineDetail
|
62
62
|
|
63
|
-
export default Timeline
|
63
|
+
export default Timeline
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= pb_rails("flex", props: { justify: "evenly" }) do %>
|
2
2
|
<%= pb_rails("flex/flex_item") do %>
|
3
|
-
<%= pb_rails("timeline", props: {orientation: "vertical",
|
3
|
+
<%= pb_rails("timeline", props: {orientation: "vertical", gap: "xs"}) do %>
|
4
4
|
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
|
5
5
|
<%= pb_rails("body", props: {
|
6
6
|
text: "Conversation started",
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<% end %>
|
24
24
|
|
25
25
|
<%= pb_rails("flex/flex_item") do %>
|
26
|
-
<%= pb_rails("timeline", props: {orientation: "vertical",
|
26
|
+
<%= pb_rails("timeline", props: {orientation: "vertical", gap: "sm"}) do %>
|
27
27
|
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
|
28
28
|
<%= pb_rails("body", props: {
|
29
29
|
text: "Conversation started",
|
@@ -46,7 +46,7 @@
|
|
46
46
|
<% end %>
|
47
47
|
|
48
48
|
<%= pb_rails("flex/flex_item") do %>
|
49
|
-
<%= pb_rails("timeline", props: {orientation: "vertical",
|
49
|
+
<%= pb_rails("timeline", props: {orientation: "vertical", gap: "md"}) do %>
|
50
50
|
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
|
51
51
|
<%= pb_rails("body", props: {
|
52
52
|
text: "Conversation started",
|
@@ -69,7 +69,7 @@
|
|
69
69
|
<% end %>
|
70
70
|
|
71
71
|
<%= pb_rails("flex/flex_item") do %>
|
72
|
-
<%= pb_rails("timeline", props: {orientation: "vertical",
|
72
|
+
<%= pb_rails("timeline", props: {orientation: "vertical", gap: "lg"}) do %>
|
73
73
|
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
|
74
74
|
<%= pb_rails("body", props: {
|
75
75
|
text: "Conversation started",
|
@@ -91,3 +91,4 @@
|
|
91
91
|
<% end %>
|
92
92
|
<% end %>
|
93
93
|
<% end %>
|
94
|
+
|
@@ -10,7 +10,7 @@ const TimelineWithGap = (props) => (
|
|
10
10
|
<Flex justify="evenly">
|
11
11
|
<FlexItem>
|
12
12
|
<Timeline
|
13
|
-
|
13
|
+
gap="xs"
|
14
14
|
orientation="vertical"
|
15
15
|
>
|
16
16
|
<Timeline.Item
|
@@ -51,7 +51,7 @@ const TimelineWithGap = (props) => (
|
|
51
51
|
</FlexItem>
|
52
52
|
<FlexItem>
|
53
53
|
<Timeline
|
54
|
-
|
54
|
+
gap="sm"
|
55
55
|
orientation="vertical"
|
56
56
|
>
|
57
57
|
<Timeline.Item
|
@@ -92,7 +92,7 @@ const TimelineWithGap = (props) => (
|
|
92
92
|
</FlexItem>
|
93
93
|
<FlexItem>
|
94
94
|
<Timeline
|
95
|
-
|
95
|
+
gap="md"
|
96
96
|
orientation="vertical"
|
97
97
|
>
|
98
98
|
<Timeline.Item
|
@@ -134,7 +134,7 @@ const TimelineWithGap = (props) => (
|
|
134
134
|
</FlexItem>
|
135
135
|
<FlexItem>
|
136
136
|
<Timeline
|
137
|
-
|
137
|
+
gap="lg"
|
138
138
|
orientation="vertical"
|
139
139
|
>
|
140
140
|
<Timeline.Item
|
@@ -1 +1 @@
|
|
1
|
-
Use the optional `
|
1
|
+
Use the optional `gap` prop to render the timeline kit with adjusted spacing between nodes. The `gap` prop will only work when utilized with a vertical timeline. Horizontal timelines will show no difference in spacing.
|
@@ -8,15 +8,15 @@ module Playbook
|
|
8
8
|
default: "horizontal"
|
9
9
|
prop :show_date, type: Playbook::Props::Boolean,
|
10
10
|
default: false
|
11
|
-
prop :
|
12
|
-
|
13
|
-
|
11
|
+
prop :gap, type: Playbook::Props::Enum,
|
12
|
+
values: %w[xs sm md lg none],
|
13
|
+
default: "none"
|
14
14
|
|
15
15
|
def classname
|
16
16
|
generate_classname("pb_timeline_kit",
|
17
17
|
orientation,
|
18
18
|
date_class,
|
19
|
-
|
19
|
+
gap_class)
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
@@ -25,8 +25,8 @@ module Playbook
|
|
25
25
|
show_date ? "with_date" : nil
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
29
|
-
|
28
|
+
def gap_class
|
29
|
+
gap == "none" ? nil : "gap_#{gap}"
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -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}
|
@@ -108,10 +108,6 @@ type MinWidth = {
|
|
108
108
|
minWidth?: string,
|
109
109
|
}
|
110
110
|
|
111
|
-
type Gap = {
|
112
|
-
gap?: string,
|
113
|
-
}
|
114
|
-
|
115
111
|
type NumberSpacing = {
|
116
112
|
numberSpacing?: "tabular",
|
117
113
|
}
|
@@ -200,7 +196,7 @@ type MinHeight = {
|
|
200
196
|
export type GlobalProps = AlignContent & AlignItems & AlignSelf &
|
201
197
|
BorderRadius & Cursor & Dark & Display & DisplaySizes & Flex & FlexDirection &
|
202
198
|
FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
|
203
|
-
LineHeight & Margin & Width & MinWidth & MaxWidth &
|
199
|
+
LineHeight & Margin & Width & MinWidth & MaxWidth & NumberSpacing & Order & Overflow & Padding &
|
204
200
|
Position & Shadow & TextAlign & Truncate & VerticalAlign & ZIndex & { hover?: string } & Top & Right & Bottom & Left & Height & MaxHeight & MinHeight;
|
205
201
|
|
206
202
|
const getResponsivePropClasses = (prop: {[key: string]: string}, classPrefix: string) => {
|
@@ -376,11 +372,6 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
376
372
|
css += maxWidth ? `max_width_${filterClassName(maxWidth)} ` : ''
|
377
373
|
return css.trimEnd()
|
378
374
|
},
|
379
|
-
gapProps: ({ gap }: Gap) => {
|
380
|
-
let css = ''
|
381
|
-
css += gap ? `gap_${gap} ` : ''
|
382
|
-
return css.trimEnd()
|
383
|
-
},
|
384
375
|
minHeightProps: ({ minHeight }: MinHeight) => {
|
385
376
|
const heightValues = ["auto", "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"]
|
386
377
|
if (heightValues.includes(minHeight)) {
|
@@ -539,15 +530,15 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
539
530
|
},
|
540
531
|
|
541
532
|
|
542
|
-
topProps: ({top}) => getPositioningPropsClasses('top', top),
|
543
|
-
|
544
|
-
rightProps: ({right}) => getPositioningPropsClasses('right', right),
|
533
|
+
topProps: ({top}) => getPositioningPropsClasses('top', top),
|
545
534
|
|
546
|
-
|
535
|
+
rightProps: ({right}) => getPositioningPropsClasses('right', right),
|
547
536
|
|
537
|
+
bottomProps:({bottom}) => getPositioningPropsClasses('bottom', bottom),
|
538
|
+
|
548
539
|
leftProps: ({left}) => getPositioningPropsClasses('left', left),
|
549
|
-
|
550
|
-
|
540
|
+
|
541
|
+
|
551
542
|
textAlignProps: ({ textAlign }: TextAlign) => {
|
552
543
|
if (typeof textAlign === 'object') {
|
553
544
|
return getResponsivePropClasses(textAlign, 'text_align')
|
@@ -567,7 +558,7 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
567
558
|
|
568
559
|
const PROP_INLINE_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => {[key: string]: any}} = {
|
569
560
|
heightProps: ({ height }: Height) => {
|
570
|
-
return height ? { height } : {};
|
561
|
+
return height ? { height } : {};
|
571
562
|
},
|
572
563
|
|
573
564
|
maxHeightProps: ({ maxHeight }: MaxHeight) => {
|
@@ -575,7 +566,7 @@ const PROP_INLINE_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => {[
|
|
575
566
|
},
|
576
567
|
|
577
568
|
minHeightProps: ({ minHeight }: MinHeight) => {
|
578
|
-
return minHeight ? { minHeight } : {};
|
569
|
+
return minHeight ? { minHeight } : {};
|
579
570
|
},
|
580
571
|
}
|
581
572
|
|