playbook_ui 14.17.0.pre.alpha.play1964tablekitheadertextstylefix7164 → 14.17.0.pre.alpha.play1966highchartsgaugedefaultpoc7331

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 (121) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +23 -3
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +11 -1
  4. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +60 -128
  5. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +3 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.jsx +58 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.md +6 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.jsx +64 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +8 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.jsx +55 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.md +3 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.html.erb +33 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.md +3 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +1 -2
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +2 -2
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +6 -2
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +6 -2
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +6 -2
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +4 -1
  22. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +97 -0
  23. data/app/pb_kits/playbook/pb_background/_background.scss +26 -0
  24. data/app/pb_kits/playbook/pb_background/_background.tsx +5 -3
  25. data/app/pb_kits/playbook/pb_background/background.test.js +5 -0
  26. data/app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx +35 -0
  27. data/app/pb_kits/playbook/pb_background/docs/_background_overlay.md +1 -0
  28. data/app/pb_kits/playbook/pb_background/docs/example.yml +1 -0
  29. data/app/pb_kits/playbook/pb_background/docs/index.js +1 -0
  30. data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +19 -45
  31. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.jsx +54 -0
  32. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.md +3 -0
  33. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +1 -0
  34. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +2 -1
  35. data/app/pb_kits/playbook/pb_copy_button/usePBCopy.ts +45 -0
  36. data/app/pb_kits/playbook/pb_draggable/_draggable.scss +43 -20
  37. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.jsx +102 -105
  38. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.md +3 -3
  39. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.jsx +50 -48
  40. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.md +1 -1
  41. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.jsx +110 -0
  42. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.md +5 -0
  43. data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table_react.jsx → _draggable_with_table.jsx} +1 -1
  44. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +3 -1
  45. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +9 -6
  46. data/app/pb_kits/playbook/pb_draggable/docs/index.js +4 -1
  47. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +68 -0
  48. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +4 -3
  49. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +23 -3
  50. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.html.erb +15 -5
  51. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +39 -6
  52. data/app/pb_kits/playbook/pb_gauge/GaugeStyles.scss +48 -0
  53. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +35 -0
  54. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +1 -0
  55. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +1 -0
  56. data/app/pb_kits/playbook/pb_gauge/docs/index.js +1 -0
  57. data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +73 -0
  58. data/app/pb_kits/playbook/pb_layout/_layout.scss +70 -1
  59. data/app/pb_kits/playbook/pb_layout/_layout.tsx +29 -2
  60. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +322 -118
  61. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +1 -1
  62. data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +74 -43
  63. data/app/pb_kits/playbook/pb_layout/subcomponents/_participant.tsx +79 -0
  64. data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +21 -4
  65. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +49 -22
  66. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +15 -4
  67. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.jsx +63 -0
  68. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.md +3 -0
  69. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +1 -7
  70. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.jsx +39 -0
  71. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.md +1 -0
  72. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.jsx +40 -0
  73. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +5 -0
  74. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +3 -0
  75. data/app/pb_kits/playbook/pb_overlay/docs/index.js +3 -0
  76. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +39 -1
  77. data/app/pb_kits/playbook/pb_table/_table.tsx +2 -2
  78. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +3 -1
  79. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +3 -1
  80. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +3 -1
  81. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +3 -1
  82. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.html.erb +34 -0
  83. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_rails.md +1 -0
  84. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.html.erb +36 -0
  85. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_rails.md +1 -0
  86. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -1
  87. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
  88. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +1 -1
  89. data/app/pb_kits/playbook/pb_table/table.rb +13 -1
  90. data/app/pb_kits/playbook/pb_table/table_header.rb +13 -1
  91. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +13 -5
  92. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.jsx +94 -0
  93. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.md +1 -0
  94. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -0
  95. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  96. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +8 -1
  97. data/dist/chunks/_typeahead-DS2YgVIJ.js +22 -0
  98. data/dist/chunks/_weekday_stacked-m_sRGgtX.js +45 -0
  99. data/dist/chunks/lib-BaT3PgL3.js +29 -0
  100. data/dist/chunks/{pb_form_validation-BvNy9Bd6.js → pb_form_validation-3c-yG89Y.js} +1 -1
  101. data/dist/chunks/vendor.js +1 -1
  102. data/dist/playbook-doc.js +1 -1
  103. data/dist/playbook-rails-react-bindings.js +1 -1
  104. data/dist/playbook-rails.js +1 -1
  105. data/dist/playbook.css +1 -1
  106. data/lib/playbook/version.rb +1 -1
  107. metadata +51 -18
  108. data/dist/chunks/_typeahead-7W5Ha5Td.js +0 -22
  109. data/dist/chunks/_weekday_stacked-DSKatW3m.js +0 -45
  110. data/dist/chunks/lib-BGzBzFZX.js +0 -29
  111. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default_rails.html.erb → _draggable_default.html.erb} +0 -0
  112. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default.md → _draggable_default_react.md} +0 -0
  113. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers_rails.html.erb → _draggable_multiple_containers.html.erb} +0 -0
  114. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers.md → _draggable_multiple_containers_react.md} +0 -0
  115. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards_rails.html.erb → _draggable_with_cards.html.erb} +0 -0
  116. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards.md → _draggable_with_cards_react.md} +0 -0
  117. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list_rails.html.erb → _draggable_with_list.html.erb} +0 -0
  118. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list.md → _draggable_with_list_react.md} +0 -0
  119. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list_rails.html.erb → _draggable_with_selectable_list.html.erb} +0 -0
  120. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list.md → _draggable_with_selectable_list_react.md} +0 -0
  121. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table.md → _draggable_with_table_rails.md} +0 -0
@@ -85,11 +85,19 @@
85
85
  .text_input_wrapper input, [class^=pb_text_input_kit] .text_input_wrapper .text_input {
86
86
  border-bottom-right-radius: 0;
87
87
  border-top-right-radius: 0;
88
- border-right-width: 0;
88
+ border-right-color: transparent;
89
89
  }
90
+ [class^=pb_text_input_kit] .text_input_wrapper input:focus,
91
+ [class^=pb_text_input_kit] .text_input_wrapper .text_input:focus {
92
+ border-right-color: $primary;
93
+ }
94
+ [class^=pb_text_input_kit].error .text_input_wrapper input,
95
+ [class^=pb_text_input_kit].error .text_input_wrapper .text_input {
96
+ border-right-color: $error;
97
+ }
90
98
  }
91
99
 
92
- & > [class^=pb_phone_number_input]:not(:first-child) {
100
+ & > [class^=pb_phone_number_input]:not(:first-child), [class^=pb_passphrase]:not(:first-child) {
93
101
  .text_input_wrapper input, [class^=pb_text_input_kit] .text_input_wrapper .text_input {
94
102
  border-bottom-left-radius: 0;
95
103
  border-top-left-radius: 0;
@@ -107,8 +115,16 @@
107
115
  .text_input {
108
116
  border-bottom-right-radius: 0;
109
117
  border-top-right-radius: 0;
110
- border-right: none;
118
+ border-right-color: transparent;
111
119
  }
120
+ [class^=pb_text_input_kit] .text_input_wrapper input:focus,
121
+ [class^=pb_text_input_kit] .text_input_wrapper .text_input:focus {
122
+ border-right-color: $primary;
123
+ }
124
+ [class^=pb_text_input_kit].error .text_input_wrapper input,
125
+ [class^=pb_text_input_kit].error .text_input_wrapper .text_input {
126
+ border-right-color: $error;
127
+ }
112
128
  }
113
129
 
114
130
  &[class*=rails] > [class^=pb_date_picker_kit] {
@@ -227,4 +243,8 @@
227
243
  padding-left: calc(var(--iti-flag-width) + 1px);
228
244
  }
229
245
  }
246
+
247
+ &:has(> [class^="pb_select"]):has(> .pb_passphrase) [class^="pb_select"] {
248
+ align-self: baseline;
249
+ }
230
250
  }
@@ -1,5 +1,4 @@
1
- <div>
2
-
1
+ <%= pb_rails("flex", props: {orientation: "column", row_gap:"md"}) do %>
3
2
  <%= pb_rails("form_group") do %>
4
3
  <%= pb_rails("text_input", props: { placeholder: "Enter Artist Name" }) %>
5
4
  <%= pb_rails("select", props: {
@@ -17,8 +16,6 @@
17
16
  ]
18
17
  }) %>
19
18
  <% end %>
20
- <br>
21
- <br>
22
19
  <%= pb_rails("form_group") do %>
23
20
  <%= pb_rails("select", props: {
24
21
  blank_selection: "Phone",
@@ -32,4 +29,17 @@
32
29
  id: "phone"
33
30
  }) %>
34
31
  <% end %>
35
- </div>
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 %>
@@ -1,11 +1,16 @@
1
- import React from 'react'
1
+ import React, {useState} from 'react'
2
2
 
3
3
  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
+ import Passphrase from '../../pb_passphrase/_passphrase'
7
9
 
8
10
  const FormGroupSelect = (props) => {
11
+ const [input, setInput] = useState("");
12
+ const handleChange = (e) => setInput(e.target.value);
13
+
9
14
  const options = [
10
15
  { value: 'Country' },
11
16
  { value: 'Pop' },
@@ -25,7 +30,10 @@ const FormGroupSelect = (props) => {
25
30
  ]
26
31
 
27
32
  return (
28
- <div>
33
+ <Flex
34
+ orientation="column"
35
+ rowGap="md"
36
+ >
29
37
  <FormGroup>
30
38
  <TextInput
31
39
  placeholder="Enter Artist Name"
@@ -37,18 +45,43 @@ const FormGroupSelect = (props) => {
37
45
  {...props}
38
46
  />
39
47
  </FormGroup>
40
- <br />
41
- <br />
42
48
  <FormGroup>
43
49
  <Select
44
50
  blankSelection="Phone"
45
51
  options={phoneOptions}
46
- />
52
+ {...props}
53
+ />
47
54
  <PhoneNumberInput
48
55
  id='default'
56
+ {...props}
49
57
  />
50
58
  </FormGroup>
51
- </div>
59
+ <FormGroup>
60
+ <PhoneNumberInput
61
+ id='default-2'
62
+ {...props}
63
+ />
64
+ <Select
65
+ blankSelection="Phone"
66
+ options={phoneOptions}
67
+ {...props}
68
+ />
69
+ </FormGroup>
70
+ <FormGroup>
71
+ <Select
72
+ blankSelection="Phone"
73
+ options={phoneOptions}
74
+ {...props}
75
+ />
76
+ <Passphrase
77
+ id="my-passphrase"
78
+ label=""
79
+ onChange={handleChange}
80
+ value={input}
81
+ {...props}
82
+ />
83
+ </FormGroup>
84
+ </Flex>
52
85
  )
53
86
  }
54
87
 
@@ -0,0 +1,48 @@
1
+ @import "../tokens/colors";
2
+ @import "../tokens/typography";
3
+
4
+ .fix {
5
+ fill: $text_lt_default;
6
+ stroke: none;
7
+
8
+ &[class*=dark] {
9
+ fill: $text_dk_default;
10
+ }
11
+ }
12
+
13
+ .suffix {
14
+ fill: $text_lt_light;
15
+ stroke: none;
16
+ font: $regular $font_larger $font_family_base;
17
+
18
+ &[class*=dark] {
19
+ fill: $text_dk_light;
20
+ }
21
+ }
22
+
23
+ .prefix {
24
+ fill: $text_lt_light;
25
+ stroke: none;
26
+ font: $regular $font_base $font_family_base;
27
+
28
+ &[class*=dark] {
29
+ fill: $text_dk_light;
30
+ }
31
+ }
32
+
33
+ rect.highcharts-background {
34
+ fill: #0000 !important;
35
+ }
36
+
37
+ .gauge-pane {
38
+ stroke-linejoin: round;
39
+ }
40
+
41
+ [class*=dark] {
42
+ color: $text_dk_default;
43
+
44
+ .pb_title_kit_size_1,
45
+ .pb_caption_kit_xs {
46
+ color: $text_dk_light;
47
+ }
48
+ }
@@ -0,0 +1,35 @@
1
+ import React from 'react'
2
+ import gaugeTheme from '../gaugeTheme'
3
+ import Highcharts from "highcharts"
4
+ import HighchartsReact from "highcharts-react-official"
5
+ import HighchartsMore from "highcharts/highcharts-more"
6
+ import SolidGauge from "highcharts/modules/solid-gauge"
7
+ import '../GaugeStyles.scss'
8
+ // Your path might look more like this
9
+ //import "playbook-ui/dist/pb_bar_graph/GaugeThemeStyles.scss";
10
+
11
+ HighchartsMore(Highcharts);
12
+ SolidGauge(Highcharts);
13
+
14
+ const data = [{ name: "Name", y: 45 }]
15
+
16
+ const baseOptions = {
17
+ chart: { type: "solidgauge" },
18
+ title: { text: "" },
19
+ series: [{ data: data }],
20
+ };
21
+
22
+ const GaugePbStyles = () => {
23
+ const options = Highcharts.merge({}, gaugeTheme, baseOptions);
24
+
25
+ return (
26
+ <div>
27
+ <HighchartsReact
28
+ highcharts={Highcharts}
29
+ options={options}
30
+ />
31
+ </div>
32
+ );
33
+ };
34
+
35
+ export default GaugePbStyles;
@@ -0,0 +1 @@
1
+ You don't need to use the Gauge Kit to apply Playbook styles to your Highcharts gauge graph. Just import gaugeTheme.ts and GaugeStyles.scss into your component, and the styles will apply automatically.
@@ -15,6 +15,7 @@ examples:
15
15
 
16
16
  react:
17
17
  - gauge_default: Default
18
+ - gauge_pb_styles: Playbook Styles
18
19
  - gauge_disable_animation: Disable Animation
19
20
  - gauge_title: Title
20
21
  - gauge_units: Units
@@ -1,4 +1,5 @@
1
1
  export { default as GaugeDefault } from './_gauge_default.jsx'
2
+ export { default as GaugePbStyles } from './_gauge_pb_styles.jsx'
2
3
  export { default as GaugeDisableAnimation } from './_gauge_disable_animation.jsx'
3
4
  export { default as GaugeFullCircle } from './_gauge_full_circle.jsx'
4
5
  export { default as GaugeHeight } from './_gauge_height.jsx'
@@ -0,0 +1,73 @@
1
+ import colors from '../tokens/exports/_colors.module.scss'
2
+ import typography from '../tokens/exports/_typography.module.scss'
3
+
4
+ const gaugeTheme = {
5
+ chart: {
6
+ events: {
7
+ render() {
8
+ this.container
9
+ const arc = this.container.querySelector('path.gauge-pane');
10
+ if (arc) arc.setAttribute('stroke-linejoin', 'round');
11
+ }
12
+ }
13
+ },
14
+ pane: {
15
+ size: "90%",
16
+ startAngle: -100,
17
+ endAngle: 100,
18
+ background: [
19
+ {
20
+ borderWidth: 20,
21
+ innerRadius: "90%",
22
+ outerRadius: "90%",
23
+ shape: "arc",
24
+ className: "gauge-pane",
25
+ borderColor: colors.border_light,
26
+ borderRadius: '50%',
27
+ },
28
+ ],
29
+ },
30
+ tooltip: {
31
+ backgroundColor: {
32
+ linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
33
+ stops: [
34
+ [0, colors.bg_dark],
35
+ [1, colors.bg_dark],
36
+ ],
37
+ },
38
+ pointFormat:
39
+ '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' +
40
+ "<b>{point.y}</b>",
41
+ followPointer: true,
42
+ },
43
+ colors: colors.data_1,
44
+ yAxis: {
45
+ min: 0,
46
+ max: 100,
47
+ lineWidth: 0,
48
+ tickPositions: [] as number[],
49
+ },
50
+ plotOptions: {
51
+ solidgauge: {
52
+ borderColor: colors.data_1,
53
+ borderWidth: 20,
54
+ radius: 90,
55
+ innerRadius: "90%",
56
+ y: -26,
57
+ dataLabels: {
58
+ borderWidth: 0,
59
+ color: colors.text_lt_default,
60
+ enabled: true,
61
+ format: '<span class="fix">{y:,f}</span>',
62
+ style: {
63
+ fontFamily: typography.font_family_base,
64
+ fontWeight: typography.regular,
65
+ fontSize: typography.heading_2,
66
+ },
67
+ y: -26,
68
+ },
69
+ },
70
+ }
71
+ }
72
+
73
+ export default gaugeTheme;
@@ -210,10 +210,78 @@ $bracket-border-width: 4px;
210
210
  border-right: $bracket-border-width solid $border_light;
211
211
  }
212
212
 
213
+ .polygon_node {
214
+ position: absolute;
215
+ top: calc(50% - 5px);
216
+ right: -10px;
217
+
218
+ width: 0;
219
+ height: 0;
220
+ border-top: 5px solid transparent;
221
+ border-bottom: 5px solid transparent;
222
+ border-left: 10px solid $border_light;
223
+ }
224
+
213
225
  .layout_round_label {
214
226
  display: none;
215
227
  }
216
228
 
229
+ .layout_participant,
230
+ .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 {
248
+ position: relative;
249
+
250
+ &::after {
251
+ content: "";
252
+ position: absolute;
253
+ top: 0;
254
+ width: 4px;
255
+ height: 100%;
256
+ }
257
+ }
258
+
259
+ .layout_participant_winner::after {
260
+ right: 0;
261
+ background: $product_6_highlight;
262
+ }
263
+
264
+ .layout_participant_self::after {
265
+ left: 0;
266
+ background: $category_1;
267
+ }
268
+
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
+
217
285
  @media (max-width: $screen-md-max) {
218
286
  flex-direction: column;
219
287
  .layout_round_label {
@@ -221,7 +289,8 @@ $bracket-border-width: 4px;
221
289
  }
222
290
  .layout_round .layout_game::after,
223
291
  .connector_container,
224
- .half_box {
292
+ .half_box,
293
+ .polygon_node {
225
294
  display: none !important;
226
295
  }
227
296
  }
@@ -6,6 +6,7 @@ import { GlobalProps, globalProps, globalInlineProps } from '../utilities/global
6
6
 
7
7
  import { Round, RoundLabel } from "./subcomponents/_round";
8
8
  import Game from "./subcomponents/_game";
9
+ import Participant from "./subcomponents/_participant";
9
10
 
10
11
  type LayoutPropTypes = {
11
12
  aria?: {[key: string]: string},
@@ -176,13 +177,38 @@ const Layout = (props: LayoutPropTypes) => {
176
177
  (child: React.ReactElement & {type: {displayName: string}}) => child.type?.displayName !== 'Side'
177
178
  )
178
179
 
179
- const numberOfRounds = Array.isArray(nonSideChildren) ? React.Children.toArray(children).filter(
180
+ const numberOfRounds = Array.isArray(children) ? React.Children.toArray(children).filter(
180
181
  (child) => {
181
182
  return (child as React.ReactElement).type === Layout.Round;
182
183
  }
183
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
+
184
210
  const bracketChildren = nonSideChildren.map(child =>
185
- React.isValidElement(child) ? React.cloneElement(child, { numberOfRounds }) : child
211
+ React.isValidElement(child) ? React.cloneElement(child, { numberOfRounds, lastRoundWithSelf }) : child
186
212
  )
187
213
 
188
214
  const filteredProps = {...props}
@@ -219,5 +245,6 @@ Layout.Footer = Footer
219
245
  Layout.Round = Round
220
246
  Layout.Game = Game
221
247
  Layout.RoundLabel = RoundLabel
248
+ Layout.Participant = Participant
222
249
 
223
250
  export default Layout