playbook_ui 14.16.0.pre.alpha.play1959tablekitstripedlogicoverridesbackground6893 → 14.16.0.pre.alpha.play1964tablekitheadertextstylefix6997
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_advanced_table/Utilities/types.ts +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +70 -0
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +83 -2
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +15 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +90 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +1 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +34 -34
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +16 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +0 -11
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.jsx +0 -7
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_inline_styles.scss +28 -24
- data/app/pb_kits/playbook/pb_detail/_detail_mixins.scss +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +8 -8
- data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +3 -4
- data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.tsx +2 -3
- data/app/pb_kits/playbook/pb_form/pb_form_validation.js +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.scss +58 -0
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +20 -7
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +190 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +5 -0
- data/app/pb_kits/playbook/pb_layout/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_layout/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_layout/layout.test.js +4 -0
- data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +90 -0
- data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +57 -0
- data/app/pb_kits/playbook/pb_lightbox/hooks/useVisibility.js +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +2 -1
- data/app/pb_kits/playbook/pb_tooltip/index.js +183 -56
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +4 -4
- data/app/pb_kits/playbook/pb_typeahead/index.ts +2 -2
- data/app/pb_kits/playbook/utilities/globalProps.ts +1 -1
- data/app/pb_kits/playbook/utilities/object.test.js +149 -1
- data/app/pb_kits/playbook/utilities/object.ts +124 -42
- data/dist/chunks/{_typeahead-N-EFroAX.js → _typeahead-Djo6qCne.js} +3 -3
- data/dist/chunks/_weekday_stacked-BV8x7Ogy.js +45 -0
- data/dist/chunks/lib-BGzBzFZX.js +29 -0
- data/dist/chunks/{pb_form_validation-DMajaRt3.js → pb_form_validation-BvNy9Bd6.js} +1 -1
- 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 +12 -7
- data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
- data/dist/chunks/_weekday_stacked-Db780bKR.js +0 -45
- data/dist/chunks/lib-Co5y3V4K.js +0 -29
@@ -14,12 +14,12 @@
|
|
14
14
|
opacity: 1;
|
15
15
|
}
|
16
16
|
&:not(:hover) {
|
17
|
-
|
17
|
+
.date-picker-inline-angle-down.cal_icon_wrapper {
|
18
18
|
svg {
|
19
19
|
display: none;
|
20
20
|
}
|
21
21
|
}
|
22
|
-
|
22
|
+
.date-picker-inline-icon-plus.cal_icon_wrapper {
|
23
23
|
svg {
|
24
24
|
color: $slate;
|
25
25
|
display: inline-block;
|
@@ -33,12 +33,12 @@
|
|
33
33
|
[class^="pb_text_input_kit"] .text_input_wrapper .flatpickr-wrapper .text_input .placeholder {
|
34
34
|
color: $primary;
|
35
35
|
}
|
36
|
-
|
36
|
+
.date-picker-inline-angle-down.cal_icon_wrapper {
|
37
37
|
svg {
|
38
38
|
display: none;
|
39
39
|
}
|
40
40
|
}
|
41
|
-
|
41
|
+
.date-picker-inline-icon-plus.cal_icon_wrapper {
|
42
42
|
svg {
|
43
43
|
display: inline-block;
|
44
44
|
color: $primary;
|
@@ -47,32 +47,34 @@
|
|
47
47
|
}
|
48
48
|
&.show-angle-down-icon {
|
49
49
|
&:not(:hover) {
|
50
|
-
|
50
|
+
.date-picker-inline-angle-down.cal_icon_wrapper {
|
51
51
|
svg {
|
52
52
|
display: inline-block;
|
53
53
|
color: $text_lt_light;
|
54
54
|
}
|
55
55
|
}
|
56
|
-
|
56
|
+
.date-picker-inline-icon-plus.cal_icon_wrapper {
|
57
57
|
svg {
|
58
58
|
display: none;
|
59
59
|
}
|
60
60
|
}
|
61
61
|
}
|
62
|
-
|
62
|
+
.date-picker-inline-icon-plus.cal_icon_wrapper {
|
63
63
|
svg {
|
64
64
|
display: none;
|
65
65
|
}
|
66
66
|
}
|
67
|
-
|
67
|
+
.date-picker-inline-angle-down.cal_icon_wrapper {
|
68
68
|
svg {
|
69
69
|
display: inline-block;
|
70
70
|
color: $primary;
|
71
71
|
}
|
72
72
|
}
|
73
73
|
}
|
74
|
-
|
75
|
-
|
74
|
+
.date_picker_input.flatpickr-input,
|
75
|
+
.date_picker_input.flatpickr-input .active,
|
76
|
+
.text_input.flatpickr-input,
|
77
|
+
.text_input.flatpickr-input .active {
|
76
78
|
border: none;
|
77
79
|
padding: 5px 5px 5px 10px;
|
78
80
|
background-color: #FFF;
|
@@ -82,8 +84,8 @@
|
|
82
84
|
box-shadow: none;
|
83
85
|
}
|
84
86
|
}
|
85
|
-
|
86
|
-
|
87
|
+
.date-picker-inline-angle-down.cal_icon_wrapper,
|
88
|
+
.date-picker-inline-icon-plus.cal_icon_wrapper {
|
87
89
|
height: 33px;
|
88
90
|
border: none;
|
89
91
|
}
|
@@ -96,12 +98,12 @@
|
|
96
98
|
[class^=pb_date_picker_kit].dark {
|
97
99
|
&.inline-date-picker {
|
98
100
|
&:not(:hover) {
|
99
|
-
|
101
|
+
.date-picker-inline-angle-down.cal_icon_wrapper {
|
100
102
|
svg {
|
101
103
|
display: none;
|
102
104
|
}
|
103
105
|
}
|
104
|
-
|
106
|
+
.date-picker-inline-icon-plus.cal_icon_wrapper {
|
105
107
|
svg {
|
106
108
|
display: inline-block;
|
107
109
|
color: $white;
|
@@ -115,12 +117,12 @@
|
|
115
117
|
[class^="pb_text_input_kit"] .text_input_wrapper .flatpickr-wrapper .text_input .placeholder {
|
116
118
|
color: $white;
|
117
119
|
}
|
118
|
-
|
120
|
+
.date-picker-inline-angle-down.cal_icon_wrapper {
|
119
121
|
svg {
|
120
122
|
display: none;
|
121
123
|
}
|
122
124
|
}
|
123
|
-
|
125
|
+
.date-picker-inline-icon-plus.cal_icon_wrapper {
|
124
126
|
svg {
|
125
127
|
display: inline-block;
|
126
128
|
color: $white;
|
@@ -129,32 +131,34 @@
|
|
129
131
|
}
|
130
132
|
&.show-angle-down-icon {
|
131
133
|
&:not(:hover) {
|
132
|
-
|
134
|
+
.date-picker-inline-angle-down.cal_icon_wrapper {
|
133
135
|
svg {
|
134
136
|
display: inline-block;
|
135
137
|
color: $white;
|
136
138
|
}
|
137
139
|
}
|
138
|
-
|
140
|
+
.date-picker-inline-icon-plus.cal_icon_wrapper {
|
139
141
|
svg {
|
140
142
|
display: none;
|
141
143
|
}
|
142
144
|
}
|
143
145
|
}
|
144
|
-
|
146
|
+
.date-picker-inline-icon-plus.cal_icon_wrapper {
|
145
147
|
svg {
|
146
148
|
display: none;
|
147
149
|
}
|
148
150
|
}
|
149
|
-
|
151
|
+
.date-picker-inline-angle-down.cal_icon_wrapper {
|
150
152
|
svg {
|
151
153
|
display: inline-block;
|
152
154
|
color: $white;
|
153
155
|
}
|
154
156
|
}
|
155
157
|
}
|
156
|
-
|
157
|
-
|
158
|
+
.date_picker_input.flatpickr-input,
|
159
|
+
.date_picker_input.flatpickr-input .active,
|
160
|
+
.text_input.flatpickr-input,
|
161
|
+
.text_input.flatpickr-input .active {
|
158
162
|
background-color: rgba($white,.10);
|
159
163
|
border: none;
|
160
164
|
padding: 5px 5px 5px 10px;
|
@@ -164,8 +168,8 @@
|
|
164
168
|
box-shadow: none;
|
165
169
|
}
|
166
170
|
}
|
167
|
-
|
168
|
-
|
171
|
+
.date-picker-inline-angle-down.cal_icon_wrapper,
|
172
|
+
.date-picker-inline-icon-plus.cal_icon_wrapper {
|
169
173
|
height: 33px;
|
170
174
|
border: none;
|
171
175
|
}
|
@@ -12,7 +12,7 @@ const DropdownWithAutocomplete = (props) => {
|
|
12
12
|
label: "Jasper Furniss",
|
13
13
|
value: "Jasper Furniss",
|
14
14
|
territory: "PHL",
|
15
|
-
title: "
|
15
|
+
title: "Lead UX Engineer",
|
16
16
|
id: "jasper-furniss",
|
17
17
|
status: "Offline"
|
18
18
|
},
|
@@ -25,18 +25,18 @@ const DropdownWithAutocomplete = (props) => {
|
|
25
25
|
status: "Away"
|
26
26
|
},
|
27
27
|
{
|
28
|
-
label: "
|
29
|
-
value: "
|
28
|
+
label: "Carlos Lima",
|
29
|
+
value: "Carlos Lima",
|
30
30
|
territory: "PHL",
|
31
|
-
title: "
|
32
|
-
id: "
|
31
|
+
title: "Nitro Developer",
|
32
|
+
id: "carlos-lima",
|
33
33
|
status: "Online"
|
34
34
|
},
|
35
35
|
{
|
36
36
|
label: "Courtney Long",
|
37
37
|
value: "Courtney Long",
|
38
38
|
territory: "PHL",
|
39
|
-
title: "UX
|
39
|
+
title: "Lead UX Designer",
|
40
40
|
id: "courtney-long",
|
41
41
|
status: "Online"
|
42
42
|
}
|
data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx
CHANGED
@@ -15,7 +15,7 @@ const DropdownWithAutocompleteAndCustomDisplay = (props) => {
|
|
15
15
|
label: "Jasper Furniss",
|
16
16
|
value: "Jasper Furniss",
|
17
17
|
territory: "PHL",
|
18
|
-
title: "
|
18
|
+
title: "Lead UX Engineer",
|
19
19
|
id: "jasper-furniss",
|
20
20
|
status: "Offline"
|
21
21
|
},
|
@@ -28,18 +28,18 @@ const DropdownWithAutocompleteAndCustomDisplay = (props) => {
|
|
28
28
|
status: "Away"
|
29
29
|
},
|
30
30
|
{
|
31
|
-
label: "
|
32
|
-
value: "
|
31
|
+
label: "Carlos Lima",
|
32
|
+
value: "Carlos Lima",
|
33
33
|
territory: "PHL",
|
34
|
-
title: "
|
35
|
-
id: "
|
34
|
+
title: "Nitro Developer",
|
35
|
+
id: "carlos-lima",
|
36
36
|
status: "Online"
|
37
37
|
},
|
38
38
|
{
|
39
39
|
label: "Courtney Long",
|
40
40
|
value: "Courtney Long",
|
41
41
|
territory: "PHL",
|
42
|
-
title: "UX
|
42
|
+
title: "Lead UX Designer",
|
43
43
|
id: "courtney-long",
|
44
44
|
status: "Online"
|
45
45
|
}
|
@@ -15,7 +15,7 @@ const DropdownWithCustomDisplay = (props) => {
|
|
15
15
|
label: "Jasper Furniss",
|
16
16
|
value: "Jasper Furniss",
|
17
17
|
territory: "PHL",
|
18
|
-
title: "
|
18
|
+
title: "Lead UX Engineer",
|
19
19
|
id: "jasper-furniss",
|
20
20
|
status: "Offline"
|
21
21
|
},
|
@@ -28,18 +28,18 @@ const DropdownWithCustomDisplay = (props) => {
|
|
28
28
|
status: "Away"
|
29
29
|
},
|
30
30
|
{
|
31
|
-
label: "
|
32
|
-
value: "
|
31
|
+
label: "Carlos Lima",
|
32
|
+
value: "Carlos Lima",
|
33
33
|
territory: "PHL",
|
34
|
-
title: "
|
35
|
-
id: "
|
34
|
+
title: "Nitro Developer",
|
35
|
+
id: "carlos-lima",
|
36
36
|
status: "Online"
|
37
37
|
},
|
38
38
|
{
|
39
39
|
label: "Courtney Long",
|
40
40
|
value: "Courtney Long",
|
41
41
|
territory: "PHL",
|
42
|
-
title: "UX
|
42
|
+
title: "Lead UX Designer",
|
43
43
|
id: "courtney-long",
|
44
44
|
status: "Online"
|
45
45
|
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<%
|
2
|
-
|
2
|
+
options = [
|
3
3
|
{
|
4
4
|
label: "Jasper Furniss",
|
5
5
|
value: "Jasper Furniss",
|
6
6
|
territory: "PHL",
|
7
|
-
title: "
|
7
|
+
title: "Lead UX Engineer",
|
8
8
|
id: "jasper-furniss",
|
9
9
|
status: "Offline"
|
10
10
|
},
|
@@ -17,22 +17,22 @@
|
|
17
17
|
status: "Away"
|
18
18
|
},
|
19
19
|
{
|
20
|
-
label: "
|
21
|
-
value: "
|
20
|
+
label: "Carlos Lima",
|
21
|
+
value: "Carlos Lima",
|
22
22
|
territory: "PHL",
|
23
|
-
title: "
|
24
|
-
id: "
|
23
|
+
title: "Nitro Developer",
|
24
|
+
id: "carlos-lima",
|
25
25
|
status: "Online"
|
26
26
|
},
|
27
27
|
{
|
28
28
|
label: "Courtney Long",
|
29
29
|
value: "Courtney Long",
|
30
30
|
territory: "PHL",
|
31
|
-
title: "UX
|
31
|
+
title: "Lead UX Designer",
|
32
32
|
id: "courtney-long",
|
33
33
|
status: "Online"
|
34
34
|
}
|
35
|
-
]
|
35
|
+
];
|
36
36
|
|
37
37
|
%>
|
38
38
|
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React from 'react'
|
2
|
-
import { map } from '
|
3
|
-
import { isEmpty, omitBy } from '../../utilities/object'
|
2
|
+
import { isEmpty, omitBy, map } from '../../utilities/object'
|
4
3
|
|
5
4
|
import Body from '../../pb_body/_body'
|
6
5
|
import Caption from '../../pb_caption/_caption'
|
@@ -46,12 +45,12 @@ const CurrentFilters = ({ dark, filters }: CurrentFiltersProps): React.ReactElem
|
|
46
45
|
dark={dark}
|
47
46
|
size={4}
|
48
47
|
tag="h4"
|
49
|
-
text={name}
|
48
|
+
text={`${name}`}
|
50
49
|
/> :
|
51
50
|
<div>
|
52
51
|
<Caption
|
53
52
|
dark={dark}
|
54
|
-
text={name}
|
53
|
+
text={`${name}`}
|
55
54
|
/>
|
56
55
|
<Title
|
57
56
|
dark={dark}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
|
-
import { map } from
|
3
|
-
import { find, partial } from '../../utilities/object'
|
2
|
+
import { find, partial, map } from '../../utilities/object'
|
4
3
|
|
5
4
|
import Button from '../../pb_button/_button'
|
6
5
|
import Icon from '../../pb_icon/_icon'
|
@@ -27,7 +26,7 @@ const directionIcon = (dir: Direction) => (
|
|
27
26
|
|
28
27
|
const renderOptions = (options: SortOptions, value: SortValue[], handleChange: (arg0: SortValue) => void) => (
|
29
28
|
map(options, (label, name) => {
|
30
|
-
const next = nextValue(value, name)
|
29
|
+
const next = nextValue(value, String(name))
|
31
30
|
return (
|
32
31
|
<ListItem key={`option-${next.name}-${next.dir}`}>
|
33
32
|
<Button
|
@@ -10,6 +10,8 @@ $list-header-height: $space_lg;
|
|
10
10
|
$list-footer-height: $space_lg;
|
11
11
|
$list-border-radius: $border_rad_lighter;
|
12
12
|
$card-border-radius: $border_rad_lightest;
|
13
|
+
$bracket-connector-width: 45px;
|
14
|
+
$bracket-border-width: 4px;
|
13
15
|
|
14
16
|
|
15
17
|
[class^=pb_layout_kit] {
|
@@ -168,6 +170,62 @@ $card-border-radius: $border_rad_lightest;
|
|
168
170
|
}
|
169
171
|
}
|
170
172
|
|
173
|
+
&[class*=_bracket]{
|
174
|
+
display: flex;
|
175
|
+
overflow-x: scroll;
|
176
|
+
|
177
|
+
div.layout_round {
|
178
|
+
display: flex;
|
179
|
+
flex-direction: column;
|
180
|
+
justify-content: space-around;
|
181
|
+
flex-grow: 1;
|
182
|
+
}
|
183
|
+
|
184
|
+
.connector_container {
|
185
|
+
display: flex;
|
186
|
+
flex-direction: column;
|
187
|
+
justify-content: space-around;
|
188
|
+
}
|
189
|
+
.right_connector {
|
190
|
+
border-top: $bracket-border-width solid $border_light;
|
191
|
+
width: $bracket-connector-width;
|
192
|
+
margin-left: $bracket-connector-width;
|
193
|
+
}
|
194
|
+
|
195
|
+
.layout_round .layout_game {
|
196
|
+
position: relative;
|
197
|
+
}
|
198
|
+
|
199
|
+
.half_box {
|
200
|
+
content: '';
|
201
|
+
position: absolute;
|
202
|
+
top: calc(50% - $bracket-border-width / 2);
|
203
|
+
height: calc(100% + $bracket-border-width);
|
204
|
+
width: $bracket-connector-width;
|
205
|
+
right: -$bracket-connector-width;
|
206
|
+
border-top-right-radius: $border_radius_lg;
|
207
|
+
border-bottom-right-radius: $border_radius_lg;
|
208
|
+
border-top: $bracket-border-width solid $border_light;
|
209
|
+
border-bottom: $bracket-border-width solid $border_light;
|
210
|
+
border-right: $bracket-border-width solid $border_light;
|
211
|
+
}
|
212
|
+
|
213
|
+
.layout_round_label {
|
214
|
+
display: none;
|
215
|
+
}
|
216
|
+
|
217
|
+
@media (max-width: $screen-md-max) {
|
218
|
+
flex-direction: column;
|
219
|
+
.layout_round_label {
|
220
|
+
display: block;
|
221
|
+
}
|
222
|
+
.layout_round .layout_game::after,
|
223
|
+
.connector_container,
|
224
|
+
.half_box {
|
225
|
+
display: none !important;
|
226
|
+
}
|
227
|
+
}
|
228
|
+
}
|
171
229
|
|
172
230
|
&[class*=_sidebar]{
|
173
231
|
$layout_sizes: (
|
@@ -4,6 +4,9 @@ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../uti
|
|
4
4
|
|
5
5
|
import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
|
6
6
|
|
7
|
+
import { Round, RoundLabel } from "./subcomponents/_round";
|
8
|
+
import Game from "./subcomponents/_game";
|
9
|
+
|
7
10
|
type LayoutPropTypes = {
|
8
11
|
aria?: {[key: string]: string},
|
9
12
|
children?: React.ReactChild[] | React.ReactChild,
|
@@ -18,7 +21,7 @@ type LayoutPropTypes = {
|
|
18
21
|
size?: "xs" | "sm" | "md" | "base" | "lg" | "xl",
|
19
22
|
variant?: "light" | "dark" | "gradient",
|
20
23
|
transparent?: boolean,
|
21
|
-
layout?: "sidebar" | "collection" | "kanban" | "content" | "masonry",
|
24
|
+
layout?: "sidebar" | "collection" | "kanban" | "content" | "masonry" | "bracket",
|
22
25
|
} & GlobalProps
|
23
26
|
|
24
27
|
type LayoutSideProps = {
|
@@ -140,7 +143,7 @@ const Layout = (props: LayoutPropTypes) => {
|
|
140
143
|
const htmlProps = buildHtmlProps(htmlOptions)
|
141
144
|
|
142
145
|
const layoutCss =
|
143
|
-
layout == 'collection'
|
146
|
+
(layout == 'collection' || layout == 'bracket')
|
144
147
|
? `pb_layout_kit_${layout}`
|
145
148
|
: layout == 'kanban'
|
146
149
|
? `pb_layout_kit_${layout}${responsiveClass}`
|
@@ -151,11 +154,9 @@ const Layout = (props: LayoutPropTypes) => {
|
|
151
154
|
})
|
152
155
|
|
153
156
|
const layoutCollapseCss =
|
154
|
-
layout == 'collection'
|
157
|
+
(layout == 'collection' || layout == 'kanban' || layout == 'bracket')
|
155
158
|
? ''
|
156
|
-
: layout
|
157
|
-
? ''
|
158
|
-
: buildCss('layout', position, 'collapse', collapse)
|
159
|
+
: buildCss('layout', position, 'collapse', collapse)
|
159
160
|
|
160
161
|
const layoutChildren = React.Children.toArray(children)
|
161
162
|
|
@@ -175,6 +176,15 @@ const Layout = (props: LayoutPropTypes) => {
|
|
175
176
|
(child: React.ReactElement & {type: {displayName: string}}) => child.type?.displayName !== 'Side'
|
176
177
|
)
|
177
178
|
|
179
|
+
const numberOfRounds = Array.isArray(nonSideChildren) ? React.Children.toArray(children).filter(
|
180
|
+
(child) => {
|
181
|
+
return (child as React.ReactElement).type === Layout.Round;
|
182
|
+
}
|
183
|
+
).length : 0
|
184
|
+
const bracketChildren = nonSideChildren.map(child =>
|
185
|
+
React.isValidElement(child) ? React.cloneElement(child, { numberOfRounds }) : child
|
186
|
+
)
|
187
|
+
|
178
188
|
const filteredProps = {...props}
|
179
189
|
delete filteredProps?.position
|
180
190
|
|
@@ -196,7 +206,7 @@ const Layout = (props: LayoutPropTypes) => {
|
|
196
206
|
style={dynamicInlineProps}
|
197
207
|
>
|
198
208
|
{subComponentTags('Side')}
|
199
|
-
{nonSideChildren}
|
209
|
+
{layout === 'bracket' ? bracketChildren : nonSideChildren}
|
200
210
|
</div>
|
201
211
|
)
|
202
212
|
}
|
@@ -206,5 +216,8 @@ Layout.Body = Body
|
|
206
216
|
Layout.Item = Item
|
207
217
|
Layout.Header = Header
|
208
218
|
Layout.Footer = Footer
|
219
|
+
Layout.Round = Round
|
220
|
+
Layout.Game = Game
|
221
|
+
Layout.RoundLabel = RoundLabel
|
209
222
|
|
210
223
|
export default Layout
|