playbook_ui 14.17.0.pre.alpha.PLAY1823maskedsanitizedtextinput7271 → 14.17.0.pre.alpha.PLAY1967bracketlayoutphase27198
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/Components/RegularTableView.tsx +3 -23
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -11
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +128 -60
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -4
- data/app/pb_kits/playbook/pb_background/_background.scss +0 -26
- data/app/pb_kits/playbook/pb_background/_background.tsx +3 -5
- data/app/pb_kits/playbook/pb_background/background.test.js +0 -5
- data/app/pb_kits/playbook/pb_background/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_background/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +2 -18
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.html.erb +5 -15
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +5 -20
- data/app/pb_kits/playbook/pb_layout/_layout.scss +2 -36
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +2 -27
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +14 -18
- data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +21 -35
- data/app/pb_kits/playbook/pb_layout/subcomponents/_participant.tsx +6 -12
- data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +4 -21
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +22 -49
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +4 -15
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +7 -1
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -3
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -3
- data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +1 -39
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_table/table.rb +1 -13
- data/app/pb_kits/playbook/pb_table/table_header.rb +1 -13
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +5 -13
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +1 -8
- data/dist/chunks/_typeahead-DZZ1n1Oe.js +22 -0
- data/dist/chunks/_weekday_stacked-P4lpbU7P.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/version.rb +1 -1
- metadata +4 -25
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.jsx +0 -58
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.md +0 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.jsx +0 -64
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.jsx +0 -55
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.html.erb +0 -33
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +0 -97
- data/app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx +0 -35
- data/app/pb_kits/playbook/pb_background/docs/_background_overlay.md +0 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.jsx +0 -63
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.md +0 -3
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.jsx +0 -39
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.md +0 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.jsx +0 -40
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +0 -5
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.html.erb +0 -34
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_rails.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.html.erb +0 -36
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_rails.md +0 -1
- data/dist/chunks/_typeahead-CtCqFlTG.js +0 -22
- data/dist/chunks/_weekday_stacked-DSsdjRl5.js +0 -45
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
<div>
|
|
2
|
+
|
|
2
3
|
<%= pb_rails("form_group") do %>
|
|
3
4
|
<%= pb_rails("text_input", props: { placeholder: "Enter Artist Name" }) %>
|
|
4
5
|
<%= pb_rails("select", props: {
|
|
@@ -16,6 +17,8 @@
|
|
|
16
17
|
]
|
|
17
18
|
}) %>
|
|
18
19
|
<% end %>
|
|
20
|
+
<br>
|
|
21
|
+
<br>
|
|
19
22
|
<%= pb_rails("form_group") do %>
|
|
20
23
|
<%= pb_rails("select", props: {
|
|
21
24
|
blank_selection: "Phone",
|
|
@@ -29,17 +32,4 @@
|
|
|
29
32
|
id: "phone"
|
|
30
33
|
}) %>
|
|
31
34
|
<% end %>
|
|
32
|
-
|
|
33
|
-
<%= pb_rails("phone_number_input", props: {
|
|
34
|
-
id: "phone2"
|
|
35
|
-
}) %>
|
|
36
|
-
<%= pb_rails("select", props: {
|
|
37
|
-
blank_selection: "Phone",
|
|
38
|
-
options: [
|
|
39
|
-
{ value: "Cell" },
|
|
40
|
-
{ value: "Work" },
|
|
41
|
-
{ value: "Home" },
|
|
42
|
-
]
|
|
43
|
-
}) %>
|
|
44
|
-
<% end %>
|
|
45
|
-
<% end %>
|
|
35
|
+
</div>
|
|
@@ -4,7 +4,6 @@ import FormGroup from '../_form_group'
|
|
|
4
4
|
import PhoneNumberInput from '../../pb_phone_number_input/_phone_number_input'
|
|
5
5
|
import Select from '../../pb_select/_select'
|
|
6
6
|
import TextInput from '../../pb_text_input/_text_input'
|
|
7
|
-
import Flex from '../../pb_flex/_flex'
|
|
8
7
|
|
|
9
8
|
const FormGroupSelect = (props) => {
|
|
10
9
|
const options = [
|
|
@@ -26,10 +25,7 @@ const FormGroupSelect = (props) => {
|
|
|
26
25
|
]
|
|
27
26
|
|
|
28
27
|
return (
|
|
29
|
-
<
|
|
30
|
-
orientation="column"
|
|
31
|
-
rowGap="md"
|
|
32
|
-
>
|
|
28
|
+
<div>
|
|
33
29
|
<FormGroup>
|
|
34
30
|
<TextInput
|
|
35
31
|
placeholder="Enter Artist Name"
|
|
@@ -41,29 +37,18 @@ const FormGroupSelect = (props) => {
|
|
|
41
37
|
{...props}
|
|
42
38
|
/>
|
|
43
39
|
</FormGroup>
|
|
40
|
+
<br />
|
|
41
|
+
<br />
|
|
44
42
|
<FormGroup>
|
|
45
43
|
<Select
|
|
46
44
|
blankSelection="Phone"
|
|
47
45
|
options={phoneOptions}
|
|
48
|
-
|
|
49
|
-
/>
|
|
46
|
+
/>
|
|
50
47
|
<PhoneNumberInput
|
|
51
48
|
id='default'
|
|
52
|
-
{...props}
|
|
53
49
|
/>
|
|
54
50
|
</FormGroup>
|
|
55
|
-
|
|
56
|
-
<PhoneNumberInput
|
|
57
|
-
id='default-2'
|
|
58
|
-
{...props}
|
|
59
|
-
/>
|
|
60
|
-
<Select
|
|
61
|
-
blankSelection="Phone"
|
|
62
|
-
options={phoneOptions}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
</FormGroup>
|
|
66
|
-
</Flex>
|
|
51
|
+
</div>
|
|
67
52
|
)
|
|
68
53
|
}
|
|
69
54
|
|
|
@@ -226,25 +226,8 @@ $bracket-border-width: 4px;
|
|
|
226
226
|
display: none;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
.layout_participant,
|
|
230
229
|
.layout_participant_winner,
|
|
231
|
-
.layout_participant_self
|
|
232
|
-
.layout_participant_winner_self,
|
|
233
|
-
.layout_participant_winner_self_last {
|
|
234
|
-
height: 60px;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.layout_tbd {
|
|
238
|
-
height: 140px;
|
|
239
|
-
display: flex;
|
|
240
|
-
flex-direction: column;
|
|
241
|
-
justify-content: center;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.layout_participant_winner,
|
|
245
|
-
.layout_participant_self,
|
|
246
|
-
.layout_participant_winner_self,
|
|
247
|
-
.layout_participant_winner_self_last {
|
|
230
|
+
.layout_participant_self {
|
|
248
231
|
position: relative;
|
|
249
232
|
|
|
250
233
|
&::after {
|
|
@@ -266,22 +249,6 @@ $bracket-border-width: 4px;
|
|
|
266
249
|
background: $category_1;
|
|
267
250
|
}
|
|
268
251
|
|
|
269
|
-
.layout_participant_winner_self::after {
|
|
270
|
-
right: 0;
|
|
271
|
-
background: $product_6_highlight;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.layout_participant_winner_self_last::after {
|
|
275
|
-
left: 0;
|
|
276
|
-
background: $category_1;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.game_separator {
|
|
280
|
-
&::before, &::after {
|
|
281
|
-
height: 2px;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
252
|
@media (max-width: $screen-md-max) {
|
|
286
253
|
flex-direction: column;
|
|
287
254
|
.layout_round_label {
|
|
@@ -289,8 +256,7 @@ $bracket-border-width: 4px;
|
|
|
289
256
|
}
|
|
290
257
|
.layout_round .layout_game::after,
|
|
291
258
|
.connector_container,
|
|
292
|
-
.half_box
|
|
293
|
-
.polygon_node {
|
|
259
|
+
.half_box {
|
|
294
260
|
display: none !important;
|
|
295
261
|
}
|
|
296
262
|
}
|
|
@@ -177,38 +177,13 @@ const Layout = (props: LayoutPropTypes) => {
|
|
|
177
177
|
(child: React.ReactElement & {type: {displayName: string}}) => child.type?.displayName !== 'Side'
|
|
178
178
|
)
|
|
179
179
|
|
|
180
|
-
const numberOfRounds = Array.isArray(
|
|
180
|
+
const numberOfRounds = Array.isArray(nonSideChildren) ? React.Children.toArray(children).filter(
|
|
181
181
|
(child) => {
|
|
182
182
|
return (child as React.ReactElement).type === Layout.Round;
|
|
183
183
|
}
|
|
184
184
|
).length : 0
|
|
185
|
-
|
|
186
|
-
const lastRoundWithSelf = React.Children.toArray(children).filter((child) => {
|
|
187
|
-
if ((child as React.ReactElement).type !== Layout.Round) {
|
|
188
|
-
return false
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
const roundElement = child as React.ReactElement
|
|
192
|
-
|
|
193
|
-
const gameChildren = React.Children.toArray(roundElement.props.children)
|
|
194
|
-
|
|
195
|
-
const hasWinningSelfParticipant = gameChildren.some((gameChild) => {
|
|
196
|
-
const gameElement = gameChild as React.ReactElement
|
|
197
|
-
|
|
198
|
-
const participantChildren = React.Children.toArray(gameElement.props.children)
|
|
199
|
-
|
|
200
|
-
return participantChildren.some((participantChild) => {
|
|
201
|
-
const participantElement = participantChild as React.ReactElement
|
|
202
|
-
const { self } = participantElement.props
|
|
203
|
-
return self === true
|
|
204
|
-
})
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
return hasWinningSelfParticipant
|
|
208
|
-
}).length
|
|
209
|
-
|
|
210
185
|
const bracketChildren = nonSideChildren.map(child =>
|
|
211
|
-
React.isValidElement(child) ? React.cloneElement(child, { numberOfRounds
|
|
186
|
+
React.isValidElement(child) ? React.cloneElement(child, { numberOfRounds }) : child
|
|
212
187
|
)
|
|
213
188
|
|
|
214
189
|
const filteredProps = {...props}
|
|
@@ -6,85 +6,85 @@ import SectionSeparator from '../../pb_section_separator/_section_separator'
|
|
|
6
6
|
|
|
7
7
|
const teamData = {
|
|
8
8
|
eagles: {
|
|
9
|
-
avatar:"https://
|
|
9
|
+
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/8/8e/Philadelphia_Eagles_logo.svg/1920px-Philadelphia_Eagles_logo.svg.png",
|
|
10
10
|
name:"Eagles",
|
|
11
11
|
rank:"#1 NFC East",
|
|
12
12
|
territory:"PHI",
|
|
13
13
|
},
|
|
14
14
|
packers: {
|
|
15
|
-
avatar:"https://
|
|
15
|
+
avatar:"https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Green_Bay_Packers_logo.svg/1920px-Green_Bay_Packers_logo.svg.png",
|
|
16
16
|
name:"Packers",
|
|
17
17
|
rank:"#3 NFC North",
|
|
18
18
|
territory:"GB",
|
|
19
19
|
},
|
|
20
20
|
vikings: {
|
|
21
|
-
avatar:"https://
|
|
21
|
+
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/4/48/Minnesota_Vikings_logo.svg/1024px-Minnesota_Vikings_logo.svg.png",
|
|
22
22
|
name:"Vikings",
|
|
23
23
|
rank:"#2 NFC North",
|
|
24
24
|
territory:"MIN",
|
|
25
25
|
},
|
|
26
26
|
rams: {
|
|
27
|
-
avatar:"https://
|
|
27
|
+
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/8/8a/Los_Angeles_Rams_logo.svg/1920px-Los_Angeles_Rams_logo.svg.png",
|
|
28
28
|
name:"Rams",
|
|
29
29
|
rank:"#1 NFC West",
|
|
30
30
|
territory:"LAR",
|
|
31
31
|
},
|
|
32
32
|
lions: {
|
|
33
|
-
avatar:"https://
|
|
33
|
+
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/7/71/Detroit_Lions_logo.svg/1920px-Detroit_Lions_logo.svg.png",
|
|
34
34
|
name:"Lions",
|
|
35
35
|
rank:"#1 NFC North",
|
|
36
36
|
territory:"DET",
|
|
37
37
|
},
|
|
38
38
|
commanders: {
|
|
39
|
-
avatar:"https://
|
|
39
|
+
avatar:"https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Washington_Commanders_logo.svg/2560px-Washington_Commanders_logo.svg.png",
|
|
40
40
|
name:"Commanders",
|
|
41
41
|
rank:"#2 NFC East",
|
|
42
42
|
territory:"WAS",
|
|
43
43
|
},
|
|
44
44
|
buccaneers: {
|
|
45
|
-
avatar:"https://
|
|
45
|
+
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/a/a2/Tampa_Bay_Buccaneers_logo.svg/1920px-Tampa_Bay_Buccaneers_logo.svg.png",
|
|
46
46
|
name:"Buccaneers",
|
|
47
47
|
rank:"#1 NFC South",
|
|
48
48
|
territory:"TB",
|
|
49
49
|
},
|
|
50
50
|
chiefs: {
|
|
51
|
-
avatar:"https://
|
|
51
|
+
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/e/e1/Kansas_City_Chiefs_logo.svg/2560px-Kansas_City_Chiefs_logo.svg.png",
|
|
52
52
|
name:"Chiefs",
|
|
53
53
|
rank:"#1 AFC West",
|
|
54
54
|
territory:"KC",
|
|
55
55
|
},
|
|
56
56
|
chargers: {
|
|
57
|
-
avatar:"https://
|
|
57
|
+
avatar:"https://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Los_Angeles_Chargers_logo.svg/2560px-Los_Angeles_Chargers_logo.svg.png",
|
|
58
58
|
name:"Chargers",
|
|
59
59
|
rank:"#2 AFC West",
|
|
60
60
|
territory:"LAC",
|
|
61
61
|
},
|
|
62
62
|
texans: {
|
|
63
|
-
avatar:"https://
|
|
63
|
+
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/2/28/Houston_Texans_logo.svg/1280px-Houston_Texans_logo.svg.png",
|
|
64
64
|
name:"Texans",
|
|
65
65
|
rank:"#1 AFC South",
|
|
66
66
|
territory:"HOU",
|
|
67
67
|
},
|
|
68
68
|
broncos: {
|
|
69
|
-
avatar:"https://
|
|
69
|
+
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/4/44/Denver_Broncos_logo.svg/2560px-Denver_Broncos_logo.svg.png",
|
|
70
70
|
name:"Broncos",
|
|
71
71
|
rank:"#3 AFC West",
|
|
72
72
|
territory:"DEN",
|
|
73
73
|
},
|
|
74
74
|
bills: {
|
|
75
|
-
avatar:"https://
|
|
75
|
+
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/7/77/Buffalo_Bills_logo.svg/1920px-Buffalo_Bills_logo.svg.png",
|
|
76
76
|
name:"Bills",
|
|
77
77
|
rank:"#1 AFC East",
|
|
78
78
|
territory:"BUF",
|
|
79
79
|
},
|
|
80
80
|
steelers: {
|
|
81
|
-
avatar:"https://
|
|
81
|
+
avatar:"https://upload.wikimedia.org/wikipedia/commons/thumb/d/de/Pittsburgh_Steelers_logo.svg/1280px-Pittsburgh_Steelers_logo.svg.png",
|
|
82
82
|
name:"Steelers",
|
|
83
83
|
rank:"#2 AFC North",
|
|
84
84
|
territory:"PIT",
|
|
85
85
|
},
|
|
86
86
|
ravens: {
|
|
87
|
-
avatar:"https://
|
|
87
|
+
avatar:"https://upload.wikimedia.org/wikipedia/en/thumb/1/16/Baltimore_Ravens_logo.svg/2560px-Baltimore_Ravens_logo.svg.png",
|
|
88
88
|
name:"Ravens",
|
|
89
89
|
rank:"#1 AFC North",
|
|
90
90
|
territory:"BAL",
|
|
@@ -121,7 +121,6 @@ const LayoutBracket = () => {
|
|
|
121
121
|
name={teamData.eagles.name}
|
|
122
122
|
points="22"
|
|
123
123
|
rank={teamData.eagles.rank}
|
|
124
|
-
self
|
|
125
124
|
territory={teamData.eagles.territory}
|
|
126
125
|
winner
|
|
127
126
|
/>
|
|
@@ -264,7 +263,6 @@ const LayoutBracket = () => {
|
|
|
264
263
|
name={teamData.eagles.name}
|
|
265
264
|
points="28"
|
|
266
265
|
rank={teamData.eagles.rank}
|
|
267
|
-
self
|
|
268
266
|
territory={teamData.eagles.territory}
|
|
269
267
|
winner
|
|
270
268
|
/>
|
|
@@ -339,7 +337,6 @@ const LayoutBracket = () => {
|
|
|
339
337
|
name={teamData.eagles.name}
|
|
340
338
|
points="55"
|
|
341
339
|
rank={teamData.eagles.rank}
|
|
342
|
-
self
|
|
343
340
|
territory={teamData.eagles.territory}
|
|
344
341
|
winner
|
|
345
342
|
/>
|
|
@@ -382,7 +379,6 @@ const LayoutBracket = () => {
|
|
|
382
379
|
rank={teamData.eagles.rank}
|
|
383
380
|
self
|
|
384
381
|
territory={teamData.eagles.territory}
|
|
385
|
-
winner
|
|
386
382
|
/>
|
|
387
383
|
</Layout.Game>
|
|
388
384
|
</Layout.Round>
|
|
@@ -6,20 +6,18 @@ import { GlobalProps, globalProps, globalInlineProps } from '../../utilities/glo
|
|
|
6
6
|
import Card from '../../pb_card/_card'
|
|
7
7
|
import SectionSeparator from '../../pb_section_separator/_section_separator'
|
|
8
8
|
import Body from '../../pb_body/_body'
|
|
9
|
-
import Flex from '../../pb_flex/_flex'
|
|
10
9
|
|
|
11
10
|
type LayoutGameProps = {
|
|
12
11
|
children: React.ReactNode[] | React.ReactNode,
|
|
13
12
|
className?: string,
|
|
14
13
|
numberOfRounds: number,
|
|
15
14
|
numberOfGames: number,
|
|
16
|
-
lastRoundWithSelf?: number,
|
|
17
15
|
isOdd: boolean,
|
|
18
16
|
} & GlobalProps
|
|
19
17
|
|
|
20
18
|
// Game component (modeled after Item)
|
|
21
19
|
const Game = (props: LayoutGameProps) => {
|
|
22
|
-
const { children, className, numberOfRounds, numberOfGames, isOdd
|
|
20
|
+
const { children, className, numberOfRounds, numberOfGames, isOdd } = props
|
|
23
21
|
const dynamicInlineProps = globalInlineProps(props)
|
|
24
22
|
|
|
25
23
|
const numberOfChildren = Array.isArray(children) ? children.length : 0
|
|
@@ -28,27 +26,17 @@ const Game = (props: LayoutGameProps) => {
|
|
|
28
26
|
|
|
29
27
|
let ratio = 0
|
|
30
28
|
let exponent
|
|
31
|
-
let currentRound = numberOfRounds
|
|
32
29
|
if (numberOfGames > 1) {
|
|
33
30
|
exponent = (numberOfRounds) - Math.log2(numberOfGames) - 1
|
|
34
31
|
ratio = 2 ** exponent
|
|
35
|
-
|
|
36
|
-
currentRound = exponent + 1
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
let hasWinner = false
|
|
40
|
-
const hasLastWinnerAndSelf = lastRoundWithSelf === currentRound
|
|
41
35
|
if (numberOfChildren === 2) {
|
|
42
|
-
const [
|
|
43
|
-
|
|
44
|
-
const firstChild = React.isValidElement(firstChildWithoutProps) ? React.cloneElement(firstChildWithoutProps, { hasLastWinnerAndSelf }) : firstChildWithoutProps
|
|
45
|
-
const secondChild = React.isValidElement(secondChildWithoutProps) ? React.cloneElement(secondChildWithoutProps, { hasLastWinnerAndSelf }) : secondChildWithoutProps
|
|
36
|
+
const [firstChild, secondChild] = React.Children.toArray(children)
|
|
46
37
|
|
|
47
38
|
if (React.isValidElement(firstChild) && React.isValidElement(secondChild)) {
|
|
48
|
-
if (
|
|
49
|
-
firstChild?.props && typeof firstChild.props === 'object' && 'winner' in firstChild.props ||
|
|
50
|
-
secondChild?.props && typeof secondChild.props === 'object' && 'winner' in secondChild.props
|
|
51
|
-
) {
|
|
39
|
+
if ('winner' in firstChild.props || 'winner' in secondChild.props) {
|
|
52
40
|
hasWinner = true
|
|
53
41
|
}
|
|
54
42
|
return (
|
|
@@ -63,7 +51,7 @@ const Game = (props: LayoutGameProps) => {
|
|
|
63
51
|
shadow="deep"
|
|
64
52
|
>
|
|
65
53
|
<Card.Body padding="none">{firstChild}</Card.Body>
|
|
66
|
-
<SectionSeparator
|
|
54
|
+
<SectionSeparator />
|
|
67
55
|
<Card.Body padding="none">{secondChild}</Card.Body>
|
|
68
56
|
</Card>
|
|
69
57
|
{isOdd && numberOfGames > 1 &&
|
|
@@ -88,25 +76,23 @@ const Game = (props: LayoutGameProps) => {
|
|
|
88
76
|
{((!isMultiple && children) || numberOfChildren >= 1) ? (
|
|
89
77
|
children
|
|
90
78
|
) : (
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
>
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
</Card>
|
|
109
|
-
</div>
|
|
79
|
+
<Card
|
|
80
|
+
marginY="xs"
|
|
81
|
+
padding="none"
|
|
82
|
+
shadow="deep"
|
|
83
|
+
>
|
|
84
|
+
<Card.Body padding="xs">
|
|
85
|
+
<Body color="lighter">
|
|
86
|
+
To be determined...
|
|
87
|
+
</Body>
|
|
88
|
+
</Card.Body>
|
|
89
|
+
<SectionSeparator />
|
|
90
|
+
<Card.Body padding="xs">
|
|
91
|
+
<Body color="lighter">
|
|
92
|
+
To be determined...
|
|
93
|
+
</Body>
|
|
94
|
+
</Card.Body>
|
|
95
|
+
</Card>
|
|
110
96
|
)}
|
|
111
97
|
{isOdd && numberOfGames > 1 &&
|
|
112
98
|
<div
|
|
@@ -23,10 +23,9 @@ type LayoutParticipantProps = {
|
|
|
23
23
|
} & GlobalProps
|
|
24
24
|
|
|
25
25
|
export const Participant = (props: LayoutParticipantProps) => {
|
|
26
|
-
const { className, name = 'To be determined...', territory = '', points, rank, avatar, winner, self
|
|
26
|
+
const { className, name = 'To be determined...', territory = '', points, rank, avatar, winner, self } = props
|
|
27
27
|
const dynamicInlineProps = globalInlineProps(props)
|
|
28
|
-
const
|
|
29
|
-
const classes = classnames(buildCss('layout_participant', winner ? 'winner' : '', self ? 'self' : '', isLastWinnerAndSelf ? 'last' : ''), globalProps(props), className)
|
|
28
|
+
const classes = classnames(buildCss('layout_participant', winner ? 'winner' : '', self ? 'self' : ''), globalProps(props), className)
|
|
30
29
|
return (
|
|
31
30
|
<Background
|
|
32
31
|
backgroundColor={winner ? "success_subtle" : "white"}
|
|
@@ -43,20 +42,15 @@ export const Participant = (props: LayoutParticipantProps) => {
|
|
|
43
42
|
/>
|
|
44
43
|
<Body flexGrow={1}>
|
|
45
44
|
<Flex justify="between">
|
|
45
|
+
<Body color={winner ? "success" : "default"}>{winner ? <strong>{name}</strong> : name}{self ? ' (You)' : ''}</Body>
|
|
46
46
|
<Body
|
|
47
|
-
color={winner
|
|
48
|
-
truncate={1}
|
|
49
|
-
>
|
|
50
|
-
{winner ? <strong>{name}{self ? ' (You)' : ''}</strong> : name + (self && !isLastWinnerAndSelf ? ' (You)' : '')}
|
|
51
|
-
</Body>
|
|
52
|
-
<Body
|
|
53
|
-
color={winner && !isLastWinnerAndSelf ? "success" : "light"}
|
|
47
|
+
color={winner ? "success" : "light"}
|
|
54
48
|
display="flex"
|
|
55
49
|
>
|
|
56
50
|
{points && (<>
|
|
57
51
|
<strong>{points}</strong>
|
|
58
52
|
<Detail
|
|
59
|
-
color={winner
|
|
53
|
+
color={winner ? "success" : "light"}
|
|
60
54
|
text="pts"
|
|
61
55
|
/>
|
|
62
56
|
</>)}
|
|
@@ -67,7 +61,7 @@ export const Participant = (props: LayoutParticipantProps) => {
|
|
|
67
61
|
|
|
68
62
|
<Badge
|
|
69
63
|
text={rank}
|
|
70
|
-
variant={winner
|
|
64
|
+
variant={winner ? "success" : self ? "notification" : "neutral"}
|
|
71
65
|
/>
|
|
72
66
|
</Body>
|
|
73
67
|
</Body>
|
|
@@ -25,33 +25,16 @@ type LayoutRoundProps = {
|
|
|
25
25
|
children: React.ReactNode[] | React.ReactNode,
|
|
26
26
|
className?: string,
|
|
27
27
|
numberOfRounds: number,
|
|
28
|
-
lastRoundWithSelf: number,
|
|
29
28
|
} & GlobalProps
|
|
30
29
|
|
|
31
30
|
export const Round = (props: LayoutRoundProps) => {
|
|
32
|
-
const { children, className, numberOfRounds
|
|
31
|
+
const { children, className, numberOfRounds } = props
|
|
33
32
|
const dynamicInlineProps = globalInlineProps(props)
|
|
34
33
|
const numberOfChildren = Array.isArray(children) ? children.length : 0
|
|
35
34
|
|
|
36
|
-
const childrenWithProps = Array.isArray(children)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
? React.cloneElement(child, {
|
|
40
|
-
numberOfRounds,
|
|
41
|
-
numberOfGames: numberOfChildren,
|
|
42
|
-
isOdd: index % 2 === 0,
|
|
43
|
-
key: `child_${index}`,
|
|
44
|
-
lastRoundWithSelf
|
|
45
|
-
})
|
|
46
|
-
: child
|
|
47
|
-
)
|
|
48
|
-
: React.isValidElement(children)
|
|
49
|
-
? React.cloneElement(children, {
|
|
50
|
-
numberOfRounds,
|
|
51
|
-
numberOfGames: numberOfChildren,
|
|
52
|
-
lastRoundWithSelf
|
|
53
|
-
})
|
|
54
|
-
: children
|
|
35
|
+
const childrenWithProps = Array.isArray(children) ? children.map((child, index) =>
|
|
36
|
+
React.isValidElement(child) ? React.cloneElement(child, { numberOfRounds, numberOfGames: numberOfChildren, isOdd: index % 2 === 0, key: `child_${index}` }) : child
|
|
37
|
+
) : children
|
|
55
38
|
|
|
56
39
|
const rightConnectors = Array.from({ length: numberOfChildren / 2 }, (_, index) => (
|
|
57
40
|
<div
|
|
@@ -18,39 +18,34 @@ $overlay_colors: (
|
|
|
18
18
|
card_dark: $card_dark,
|
|
19
19
|
bg_dark: $bg_dark,
|
|
20
20
|
bg_light: $bg_light,
|
|
21
|
-
black: $black,
|
|
22
|
-
white: $white,
|
|
23
|
-
success: $success,
|
|
24
|
-
error: $error
|
|
25
21
|
);
|
|
26
22
|
|
|
27
|
-
@mixin overlay($direction, $size, $color
|
|
23
|
+
@mixin overlay($direction, $size, $color) {
|
|
28
24
|
display: block;
|
|
29
25
|
position: absolute;
|
|
30
26
|
pointer-events: none;
|
|
31
27
|
z-index: 1;
|
|
32
28
|
content: "";
|
|
33
29
|
|
|
34
|
-
@if $
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
background: $color;
|
|
30
|
+
@if $direction == "left" {
|
|
31
|
+
inset: 0 auto 0 0;
|
|
32
|
+
background: linear-gradient(to right, $color 0%, transparent 100%);
|
|
33
|
+
width: $size;
|
|
34
|
+
}
|
|
35
|
+
@if $direction == "right" {
|
|
36
|
+
inset: 0 0 0 auto;
|
|
37
|
+
background: linear-gradient(to left, $color 0%, transparent 100%);
|
|
38
|
+
width: $size;
|
|
39
|
+
}
|
|
40
|
+
@if $direction == "top" {
|
|
41
|
+
inset: 0 0 auto 0;
|
|
42
|
+
background: linear-gradient(to bottom, $color 0%, transparent 100%);
|
|
43
|
+
height: $size;
|
|
44
|
+
}
|
|
45
|
+
@if $direction == "bottom" {
|
|
46
|
+
inset: auto 0 0 0;
|
|
47
|
+
background: linear-gradient(to top, $color 0%, transparent 100%);
|
|
48
|
+
height: $size;
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
51
|
|
|
@@ -74,7 +69,7 @@ $overlay_colors: (
|
|
|
74
69
|
pointer-events: none;
|
|
75
70
|
z-index: 1;
|
|
76
71
|
}
|
|
77
|
-
|
|
72
|
+
|
|
78
73
|
&.overlay-hide-scrollbar {
|
|
79
74
|
& [class*="overflow_x_auto"],
|
|
80
75
|
& [class*="overflow_y_auto"],
|
|
@@ -82,31 +77,9 @@ $overlay_colors: (
|
|
|
82
77
|
&::-webkit-scrollbar {
|
|
83
78
|
display: none !important;
|
|
84
79
|
}
|
|
85
|
-
|
|
80
|
+
|
|
86
81
|
-ms-overflow-style: none !important;
|
|
87
82
|
scrollbar-width: none !important;
|
|
88
83
|
}
|
|
89
84
|
}
|
|
90
|
-
|
|
91
|
-
&.no_gradient {
|
|
92
|
-
@each $color_name, $color in $overlay_colors {
|
|
93
|
-
.overlay_#{$color_name} {
|
|
94
|
-
@each $name, $size in $overlay_sizes {
|
|
95
|
-
@each $position in $overlay_positions {
|
|
96
|
-
&_#{$position}_#{$name} {
|
|
97
|
-
@include overlay($position, $size, $color, false);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@each $key, $value in $opacity {
|
|
105
|
-
&.#{$key} {
|
|
106
|
-
[class^=overlay] {
|
|
107
|
-
opacity: $value;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
85
|
}
|
|
@@ -7,7 +7,7 @@ import OverlayToken from './subcomponents/_overlay_token'
|
|
|
7
7
|
|
|
8
8
|
export type OverlayChildrenProps = {
|
|
9
9
|
children: React.ReactNode[] | React.ReactNode,
|
|
10
|
-
color: "card_light" | "bg_light" | "card_dark" | "bg_dark"
|
|
10
|
+
color: "card_light" | "bg_light" | "card_dark" | "bg_dark",
|
|
11
11
|
dynamic?: boolean,
|
|
12
12
|
position: string,
|
|
13
13
|
size: string,
|
|
@@ -18,16 +18,14 @@ type OverlayProps = {
|
|
|
18
18
|
aria?: { [key: string]: string },
|
|
19
19
|
className?: string,
|
|
20
20
|
children: React.ReactNode[] | React.ReactNode,
|
|
21
|
-
color: "card_light" | "bg_light" | "card_dark" | "bg_dark"
|
|
21
|
+
color: "card_light" | "bg_light" | "card_dark" | "bg_dark",
|
|
22
22
|
data?: { [key: string]: string },
|
|
23
23
|
dynamic?: false,
|
|
24
|
-
gradient?: boolean,
|
|
25
24
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
|
|
26
25
|
id?: string,
|
|
27
26
|
layout: { [key: string]: string },
|
|
28
|
-
opacity: 'opacity_1' | 'opacity_2' | 'opacity_3' | 'opacity_4' | 'opacity_5' | 'opacity_6' | 'opacity_7' | 'opacity_8' | 'opacity_9' | 'opacity_10',
|
|
29
27
|
scrollBarNone?: boolean,
|
|
30
|
-
|
|
28
|
+
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
const Overlay = (props: OverlayProps) => {
|
|
@@ -38,24 +36,15 @@ const Overlay = (props: OverlayProps) => {
|
|
|
38
36
|
color = "card_light",
|
|
39
37
|
data = {},
|
|
40
38
|
dynamic = false,
|
|
41
|
-
gradient = true,
|
|
42
39
|
htmlOptions = {},
|
|
43
40
|
id,
|
|
44
41
|
layout = { "bottom": "full" },
|
|
45
|
-
opacity,
|
|
46
42
|
scrollBarNone = false,
|
|
47
43
|
} = props
|
|
48
44
|
|
|
49
45
|
const ariaProps = buildAriaProps(aria)
|
|
50
46
|
const dataProps = buildDataProps(data)
|
|
51
|
-
const classes = classnames(
|
|
52
|
-
buildCss('pb_overlay'),
|
|
53
|
-
{ 'overlay-hide-scrollbar': scrollBarNone },
|
|
54
|
-
globalProps(props),
|
|
55
|
-
gradient === false ? 'no_gradient' : '',
|
|
56
|
-
opacity,
|
|
57
|
-
className
|
|
58
|
-
)
|
|
47
|
+
const classes = classnames(buildCss('pb_overlay'), { 'overlay-hide-scrollbar': scrollBarNone }, globalProps(props), className )
|
|
59
48
|
const htmlProps = buildHtmlProps(htmlOptions)
|
|
60
49
|
const dynamicInlineProps = globalInlineProps(props)
|
|
61
50
|
|