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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +3 -23
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -11
  4. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +128 -60
  5. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +0 -3
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +2 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +2 -2
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +2 -6
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +2 -6
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -6
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -4
  14. data/app/pb_kits/playbook/pb_background/_background.scss +0 -26
  15. data/app/pb_kits/playbook/pb_background/_background.tsx +3 -5
  16. data/app/pb_kits/playbook/pb_background/background.test.js +0 -5
  17. data/app/pb_kits/playbook/pb_background/docs/example.yml +0 -1
  18. data/app/pb_kits/playbook/pb_background/docs/index.js +0 -1
  19. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +2 -18
  20. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.html.erb +5 -15
  21. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +5 -20
  22. data/app/pb_kits/playbook/pb_layout/_layout.scss +2 -36
  23. data/app/pb_kits/playbook/pb_layout/_layout.tsx +2 -27
  24. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +14 -18
  25. data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +21 -35
  26. data/app/pb_kits/playbook/pb_layout/subcomponents/_participant.tsx +6 -12
  27. data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +4 -21
  28. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +22 -49
  29. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +4 -15
  30. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +7 -1
  31. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -3
  32. data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -3
  33. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +1 -39
  34. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -1
  35. data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -2
  36. data/app/pb_kits/playbook/pb_table/table.rb +1 -13
  37. data/app/pb_kits/playbook/pb_table/table_header.rb +1 -13
  38. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +5 -13
  39. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +1 -8
  40. data/dist/chunks/_typeahead-DZZ1n1Oe.js +22 -0
  41. data/dist/chunks/_weekday_stacked-P4lpbU7P.js +45 -0
  42. data/dist/chunks/vendor.js +1 -1
  43. data/dist/playbook-doc.js +1 -1
  44. data/dist/playbook-rails-react-bindings.js +1 -1
  45. data/dist/playbook-rails.js +1 -1
  46. data/dist/playbook.css +1 -1
  47. data/lib/playbook/version.rb +1 -1
  48. metadata +4 -25
  49. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.jsx +0 -58
  50. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.md +0 -6
  51. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.jsx +0 -64
  52. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +0 -8
  53. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.jsx +0 -55
  54. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.md +0 -3
  55. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.html.erb +0 -33
  56. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.md +0 -3
  57. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +0 -97
  58. data/app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx +0 -35
  59. data/app/pb_kits/playbook/pb_background/docs/_background_overlay.md +0 -1
  60. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.jsx +0 -63
  61. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.md +0 -3
  62. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.jsx +0 -39
  63. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.md +0 -1
  64. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.jsx +0 -40
  65. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +0 -5
  66. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.html.erb +0 -34
  67. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_rails.md +0 -1
  68. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.html.erb +0 -36
  69. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_rails.md +0 -1
  70. data/dist/chunks/_typeahead-CtCqFlTG.js +0 -22
  71. data/dist/chunks/_weekday_stacked-DSsdjRl5.js +0 -45
@@ -1,4 +1,5 @@
1
- <%= pb_rails("flex", props: {orientation: "column", row_gap:"md"}) do %>
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
- <%= pb_rails("form_group") do %>
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
- <Flex
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
- {...props}
49
- />
46
+ />
50
47
  <PhoneNumberInput
51
48
  id='default'
52
- {...props}
53
49
  />
54
50
  </FormGroup>
55
- <FormGroup>
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(children) ? React.Children.toArray(children).filter(
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, lastRoundWithSelf }) : child
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://images.unsplash.com/photo-1628703117067-fb7c9c20946e?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8ZWFnbGVzfGVufDB8fDB8fHww",
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://images.unsplash.com/photo-1486297678162-eb2a19b0a32d?q=80&w=500&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
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://images.unsplash.com/photo-1525540796810-55f9fbc5592f?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTV8fHZpa2luZ3xlbnwwfHwwfHx8MA%3D%3D",
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://images.unsplash.com/photo-1490739043913-239b6cdf4084?q=80&w=500&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
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://images.unsplash.com/photo-1614027164847-1b28cfe1df60?q=80&w=500&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
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://images.unsplash.com/photo-1501466044931-62695aada8e9?q=80&w=500&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
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://images.unsplash.com/photo-1584116843008-46d529f04145?q=80&w=500&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
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://plus.unsplash.com/premium_photo-1697729864667-57f5f29e946b?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8a2Fuc2FzJTIwY2l0eXxlbnwwfHwwfHx8MA%3D%3D",
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://images.unsplash.com/photo-1529310399831-ed472b81d589?q=80&w=500&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
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://images.unsplash.com/photo-1545345540-ea5d968030af?q=80&w=500&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
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://images.unsplash.com/photo-1553284965-83fd3e82fa5a?q=80&w=500&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
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://images.unsplash.com/photo-1575414914265-ebc9aa2637f4?q=80&w=500&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
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://plus.unsplash.com/premium_photo-1697730155764-cc8ca8f78cbe?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8cGl0dHNidXJnaHxlbnwwfHwwfHx8MA%3D%3D",
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://images.unsplash.com/photo-1433888376991-1297486ba3f5?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8cmF2ZW58ZW58MHx8MHx8fDA%3D",
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, lastRoundWithSelf } = props
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 [firstChildWithoutProps, secondChildWithoutProps] = React.Children.toArray(children)
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 className="game_separator"/>
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
- <div className="layout_tbd">
92
- <Card
93
- marginY="xs"
94
- padding="none"
95
- shadow="deep"
96
- >
97
- <Card.Body padding="xs">
98
- <Body color="light">
99
- To be determined...
100
- </Body>
101
- </Card.Body>
102
- <SectionSeparator className="game_separator"/>
103
- <Card.Body padding="xs">
104
- <Body color="light">
105
- To be determined...
106
- </Body>
107
- </Card.Body>
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, hasLastWinnerAndSelf } = props
26
+ const { className, name = 'To be determined...', territory = '', points, rank, avatar, winner, self } = props
27
27
  const dynamicInlineProps = globalInlineProps(props)
28
- const isLastWinnerAndSelf = hasLastWinnerAndSelf && self && winner
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 && !isLastWinnerAndSelf ? "success" : "default"}
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 && !isLastWinnerAndSelf ? "success" : "light"}
53
+ color={winner ? "success" : "light"}
60
54
  text="pts"
61
55
  />
62
56
  </>)}
@@ -67,7 +61,7 @@ export const Participant = (props: LayoutParticipantProps) => {
67
61
  &nbsp;
68
62
  <Badge
69
63
  text={rank}
70
- variant={winner && !isLastWinnerAndSelf ? "success" : self ? "notification" : "neutral"}
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, lastRoundWithSelf } = props
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
- ? children.map((child, index) =>
38
- React.isValidElement(child)
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, $apply_gradient: true) {
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 $apply_gradient {
35
- @if $direction == "left" {
36
- inset: 0 auto 0 0;
37
- background: linear-gradient(to right, $color 0%, transparent 100%);
38
- width: $size;
39
- } @else if $direction == "right" {
40
- inset: 0 0 0 auto;
41
- background: linear-gradient(to left, $color 0%, transparent 100%);
42
- width: $size;
43
- } @else if $direction == "top" {
44
- inset: 0 0 auto 0;
45
- background: linear-gradient(to bottom, $color 0%, transparent 100%);
46
- height: $size;
47
- } @else if $direction == "bottom" {
48
- inset: auto 0 0 0;
49
- background: linear-gradient(to top, $color 0%, transparent 100%);
50
- height: $size;
51
- }
52
- } @else {
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" | "black" | "white" | "success" | "error",
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" | "black" | "white" | "success" | "error",
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