playbook_ui 14.18.0.pre.alpha.revert4567revert4553PLAY2056ATcolbordercolors7469 → 14.18.0.pre.rc.0

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 (189) 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 +3 -67
  4. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +2 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +19 -29
  6. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +143 -365
  7. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +1 -14
  8. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +1 -6
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +2 -1
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +2 -2
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +2 -6
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +2 -6
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -10
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -6
  17. data/app/pb_kits/playbook/pb_advanced_table/index.js +0 -7
  18. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
  19. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +1 -1
  20. data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +2 -2
  21. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +2 -2
  22. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +1 -1
  23. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +1 -1
  24. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +1 -1
  25. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +1 -1
  26. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +1 -1
  27. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +1 -1
  28. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +1 -1
  29. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +1 -1
  30. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +1 -1
  31. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +2 -2
  32. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +1 -1
  33. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +1 -1
  34. data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +3 -2
  35. data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +1 -2
  36. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +1 -39
  37. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +0 -4
  38. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +1 -9
  39. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.test.js +0 -14
  40. data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +0 -2
  41. data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +0 -1
  42. data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +45 -19
  43. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +0 -2
  44. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +1 -2
  45. data/app/pb_kits/playbook/pb_copy_button/index.js +20 -46
  46. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +0 -12
  47. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -12
  48. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +1 -50
  49. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.jsx +1 -4
  50. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.md +0 -4
  51. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
  52. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.md +1 -5
  53. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -2
  54. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +0 -1
  55. data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +0 -10
  56. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -10
  57. data/app/pb_kits/playbook/pb_dialog/dialog.rb +0 -2
  58. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -1
  59. data/app/pb_kits/playbook/pb_dialog/index.js +14 -106
  60. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -3
  61. data/app/pb_kits/playbook/pb_draggable/draggable.rb +1 -9
  62. data/app/pb_kits/playbook/pb_draggable/index.js +142 -139
  63. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +1 -1
  64. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +1 -4
  65. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
  66. data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -1
  67. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +3 -23
  68. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.html.erb +5 -15
  69. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +6 -39
  70. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +0 -1
  71. data/app/pb_kits/playbook/pb_gauge/docs/index.js +0 -1
  72. data/app/pb_kits/playbook/pb_layout/_layout.scss +1 -70
  73. data/app/pb_kits/playbook/pb_layout/_layout.tsx +2 -29
  74. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +118 -322
  75. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +1 -1
  76. data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +43 -74
  77. data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +4 -21
  78. data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -1
  79. data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -1
  80. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +22 -83
  81. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +7 -39
  82. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +7 -1
  83. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -5
  84. data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -5
  85. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +1 -39
  86. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +0 -13
  87. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -3
  88. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +1 -8
  89. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +0 -2
  90. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
  91. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
  92. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +0 -19
  93. data/app/pb_kits/playbook/pb_popover/docs/example.yml +0 -1
  94. data/app/pb_kits/playbook/pb_popover/index.ts +1 -13
  95. data/app/pb_kits/playbook/pb_popover/popover.rb +0 -2
  96. data/app/pb_kits/playbook/pb_select/docs/_select_error.jsx +2 -7
  97. data/app/pb_kits/playbook/pb_table/_table.tsx +2 -2
  98. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +1 -3
  99. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +1 -3
  100. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +1 -3
  101. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +1 -3
  102. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +1 -1
  103. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +5 -13
  104. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx +1 -9
  105. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -2
  106. data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -1
  107. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +1 -8
  108. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.jsx +1 -7
  109. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.jsx +2 -6
  110. data/dist/chunks/_typeahead-C2GOKWtm.js +22 -0
  111. data/dist/chunks/_weekday_stacked-CFGTPT0O.js +45 -0
  112. data/dist/chunks/lib-BGzBzFZX.js +29 -0
  113. data/dist/chunks/{pb_form_validation-BWjy4bFn.js → pb_form_validation-BvNy9Bd6.js} +1 -1
  114. data/dist/chunks/vendor.js +1 -1
  115. data/dist/menu.yml +2 -2
  116. data/dist/playbook-doc.js +1 -19
  117. data/dist/playbook-rails-react-bindings.js +1 -1
  118. data/dist/playbook-rails.js +1 -1
  119. data/dist/playbook.css +1 -1
  120. data/lib/playbook/version.rb +2 -2
  121. metadata +8 -71
  122. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.jsx +0 -80
  123. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.md +0 -3
  124. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.html.erb +0 -58
  125. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.md +0 -3
  126. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.jsx +0 -66
  127. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.md +0 -10
  128. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.jsx +0 -58
  129. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.md +0 -6
  130. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.jsx +0 -64
  131. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +0 -8
  132. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.jsx +0 -55
  133. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.md +0 -3
  134. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.html.erb +0 -33
  135. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.md +0 -3
  136. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +0 -97
  137. data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +0 -53
  138. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +0 -38
  139. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +0 -1
  140. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.html.erb +0 -28
  141. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.jsx +0 -42
  142. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.md +0 -1
  143. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.jsx +0 -54
  144. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.md +0 -3
  145. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.html.erb +0 -14
  146. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.md +0 -3
  147. data/app/pb_kits/playbook/pb_copy_button/usePBCopy.ts +0 -45
  148. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +0 -34
  149. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.md +0 -14
  150. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +0 -20
  151. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +0 -14
  152. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames.html.erb +0 -117
  153. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames_rails.md +0 -9
  154. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.html.erb +0 -43
  155. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.html.erb +0 -55
  156. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors_rails.md +0 -1
  157. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.html.erb +0 -42
  158. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.md +0 -1
  159. data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.html.erb +0 -41
  160. data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.md +0 -1
  161. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +0 -30
  162. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +0 -1
  163. data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +0 -85
  164. data/app/pb_kits/playbook/pb_layout/subcomponents/_participant.tsx +0 -79
  165. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +0 -52
  166. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +0 -1
  167. data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +0 -110
  168. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.jsx +0 -63
  169. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.md +0 -3
  170. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.jsx +0 -49
  171. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.md +0 -1
  172. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.jsx +0 -81
  173. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.md +0 -1
  174. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.jsx +0 -39
  175. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.md +0 -1
  176. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.jsx +0 -40
  177. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +0 -5
  178. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.html.erb +0 -10
  179. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.jsx +0 -20
  180. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.md +0 -1
  181. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.html.erb +0 -46
  182. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.md +0 -1
  183. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.jsx +0 -94
  184. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.md +0 -1
  185. data/dist/chunks/_typeahead-D8CsVBZO.js +0 -22
  186. data/dist/chunks/_weekday_stacked-D3oLTSkH.js +0 -45
  187. data/dist/chunks/lib-BmTAc7Nc.js +0 -29
  188. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_react.md → _draggable_drop_zones.md} +0 -0
  189. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_colors_react.md → _draggable_drop_zones_colors.md} +0 -0
@@ -5,110 +5,79 @@ import { GlobalProps, globalProps, globalInlineProps } from '../../utilities/glo
5
5
 
6
6
  import Card from '../../pb_card/_card'
7
7
  import SectionSeparator from '../../pb_section_separator/_section_separator'
8
- import Body from '../../pb_body/_body'
9
- import Flex from '../../pb_flex/_flex'
10
8
 
11
9
  type LayoutGameProps = {
12
10
  children: React.ReactNode[] | React.ReactNode,
13
11
  className?: string,
14
12
  numberOfRounds: number,
15
13
  numberOfGames: number,
16
- lastRoundWithSelf?: number,
17
14
  isOdd: boolean,
18
15
  } & GlobalProps
19
16
 
20
17
  // Game component (modeled after Item)
21
18
  const Game = (props: LayoutGameProps) => {
22
- const { children, className, numberOfRounds, numberOfGames, isOdd, lastRoundWithSelf } = props
19
+ const { children, className, numberOfRounds, numberOfGames, isOdd } = props
23
20
  const dynamicInlineProps = globalInlineProps(props)
24
-
21
+
25
22
  const numberOfChildren = Array.isArray(children) ? children.length : 0
26
-
23
+
27
24
  const isMultiple = Array.isArray(children)
28
-
25
+
29
26
  let ratio = 0
30
27
  let exponent
31
- let currentRound = numberOfRounds
32
28
  if (numberOfGames > 1) {
33
29
  exponent = (numberOfRounds) - Math.log2(numberOfGames) - 1
34
30
  ratio = 2 ** exponent
35
-
36
- currentRound = exponent + 1
37
31
  }
38
-
39
- let hasWinner = false
40
- const hasLastWinnerAndSelf = lastRoundWithSelf === currentRound
32
+
41
33
  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
46
-
47
- 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
- ) {
52
- hasWinner = true
53
- }
54
- return (
55
- <div
56
- className={classnames('layout_game', globalProps(props), className)}
57
- style={dynamicInlineProps}
34
+ const [firstChild, secondChild] = React.Children.toArray(children)
35
+
36
+ if (React.isValidElement(firstChild) && React.isValidElement(secondChild)) {
37
+ return (
38
+ <div
39
+ className={classnames('layout_game', globalProps(props), className)}
40
+ style={dynamicInlineProps}
41
+ >
42
+ <Card
43
+ marginY="xs"
44
+ padding="none"
45
+ shadow="deep"
58
46
  >
59
- <Card
60
- marginY="xs"
61
- overflow="hidden"
62
- padding="none"
63
- shadow="deep"
64
- >
65
- <Card.Body padding="none">{firstChild}</Card.Body>
66
- <SectionSeparator className="game_separator"/>
67
- <Card.Body padding="none">{secondChild}</Card.Body>
68
- </Card>
69
- {isOdd && numberOfGames > 1 &&
70
- <div
71
- className="half_box"
72
- style={{ height: `calc(${ratio} * 100% + 4px)` }}
73
- />
74
- }
75
- {numberOfGames > 1 && hasWinner &&
76
- <div className="polygon_node" />
77
- }
78
- </div>
47
+ <Card.Body padding="xs">{firstChild}</Card.Body>
48
+ <SectionSeparator />
49
+ <Card.Body padding="xs">{secondChild}</Card.Body>
50
+ </Card>
51
+ {isOdd && numberOfGames > 1 &&
52
+ <div
53
+ className="half_box"
54
+ style={{ height: `calc(${ratio} * 100% + 4px)` }}
55
+ />
56
+ }
57
+ </div>
79
58
  )
80
59
  }
81
60
  }
82
-
61
+
83
62
  return (
84
63
  <div
85
64
  className={classnames('layout_game', globalProps(props), className)}
86
65
  style={dynamicInlineProps}
87
66
  >
88
- {((!isMultiple && children) || numberOfChildren >= 1) ? (
89
- children
90
- ) : (
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>
110
- )}
111
- {isOdd && numberOfGames > 1 &&
67
+ {((!isMultiple && children) || numberOfChildren >= 1 )? (
68
+ children
69
+ ) : (
70
+ <Card
71
+ marginY="xs"
72
+ padding="none"
73
+ shadow="deep"
74
+ >
75
+ <Card.Body padding="xs">To be determined...</Card.Body>
76
+ <SectionSeparator />
77
+ <Card.Body padding="xs">To be determined...</Card.Body>
78
+ </Card>
79
+ )}
80
+ {isOdd && numberOfGames > 1 &&
112
81
  <div
113
82
  className="half_box"
114
83
  style={{ height: `calc(${ratio} * 100% + 4px)` }}
@@ -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
@@ -11,7 +11,6 @@ examples:
11
11
 
12
12
  react:
13
13
  - line_graph_default: Default
14
- - line_graph_pb_styles: Playbook Styles
15
14
  - line_graph_legend: Legend
16
15
  - line_graph_legend_position: Legend Position
17
16
  - line_graph_legend_nonclickable: Legend Nonclickable
@@ -4,4 +4,3 @@ export { default as LineGraphLegendPosition } from './_line_graph_legend_positio
4
4
  export { default as LineGraphLegendNonclickable } from './_line_graph_legend_nonclickable.jsx'
5
5
  export { default as LineGraphHeight } from './_line_graph_height.jsx'
6
6
  export { default as LineGraphColors } from './_line_graph_colors.jsx'
7
- export { default as LineGraphPbStyles } from './_line_graph_pb_styles.jsx'
@@ -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,65 +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
- &.overlay-full-screen {
92
- position: fixed;
93
- top: 0;
94
- left: 0;
95
- right: 0;
96
- bottom: 0;
97
- width: 100vw;
98
- height: 100vh;
99
- z-index: 9999;
100
-
101
- &.no_gradient {
102
- @each $color_name, $color in $overlay_colors {
103
- &[data-overlay-color="#{$color_name}"] {
104
- &::before {
105
- content: "";
106
- position: absolute;
107
- top: 0;
108
- left: 0;
109
- right: 0;
110
- bottom: 0;
111
- background: $color;
112
- pointer-events: none;
113
- }
114
- }
115
- }
116
- }
117
-
118
- @each $key, $value in $opacity {
119
- &.#{$key}::before {
120
- opacity: $value;
121
- }
122
- }
123
- }
124
-
125
- &.no_gradient {
126
- @each $color_name, $color in $overlay_colors {
127
- .overlay_#{$color_name} {
128
- @each $name, $size in $overlay_sizes {
129
- @each $position in $overlay_positions {
130
- &_#{$position}_#{$name} {
131
- @include overlay($position, $size, $color, false);
132
- }
133
- }
134
- }
135
- }
136
- }
137
-
138
- @each $key, $value in $opacity {
139
- &.#{$key} {
140
- [class^=overlay] {
141
- opacity: $value;
142
- }
143
- }
144
- }
145
- }
146
85
  }
@@ -7,9 +7,8 @@ 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
- gradient?: boolean,
13
12
  position: string,
14
13
  size: string,
15
14
  scrollBarNone?: boolean,
@@ -19,17 +18,14 @@ type OverlayProps = {
19
18
  aria?: { [key: string]: string },
20
19
  className?: string,
21
20
  children: React.ReactNode[] | React.ReactNode,
22
- color: "card_light" | "bg_light" | "card_dark" | "bg_dark" | "black" | "white" | "success" | "error",
21
+ color: "card_light" | "bg_light" | "card_dark" | "bg_dark",
23
22
  data?: { [key: string]: string },
24
23
  dynamic?: false,
25
- fullScreen?: boolean,
26
- gradient?: boolean,
27
24
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
28
25
  id?: string,
29
26
  layout: { [key: string]: string },
30
- opacity: 'opacity_1' | 'opacity_2' | 'opacity_3' | 'opacity_4' | 'opacity_5' | 'opacity_6' | 'opacity_7' | 'opacity_8' | 'opacity_9' | 'opacity_10',
31
27
  scrollBarNone?: boolean,
32
-
28
+
33
29
  }
34
30
 
35
31
  const Overlay = (props: OverlayProps) => {
@@ -40,26 +36,15 @@ const Overlay = (props: OverlayProps) => {
40
36
  color = "card_light",
41
37
  data = {},
42
38
  dynamic = false,
43
- fullScreen = false,
44
- gradient = true,
45
39
  htmlOptions = {},
46
40
  id,
47
41
  layout = { "bottom": "full" },
48
- opacity,
49
42
  scrollBarNone = false,
50
43
  } = props
51
44
 
52
45
  const ariaProps = buildAriaProps(aria)
53
46
  const dataProps = buildDataProps(data)
54
- const classes = classnames(
55
- buildCss('pb_overlay'),
56
- { 'overlay-hide-scrollbar': scrollBarNone },
57
- { 'overlay-full-screen': fullScreen },
58
- { 'no_gradient': gradient === false },
59
- globalProps(props),
60
- opacity,
61
- className
62
- )
47
+ const classes = classnames(buildCss('pb_overlay'), { 'overlay-hide-scrollbar': scrollBarNone }, globalProps(props), className )
63
48
  const htmlProps = buildHtmlProps(htmlOptions)
64
49
  const dynamicInlineProps = globalInlineProps(props)
65
50
 
@@ -68,9 +53,6 @@ const Overlay = (props: OverlayProps) => {
68
53
  }
69
54
 
70
55
  const getSize = () => {
71
- if (fullScreen) {
72
- return "100%"
73
- }
74
56
  return Object.values(layout)[0]
75
57
  }
76
58
 
@@ -82,37 +64,23 @@ const Overlay = (props: OverlayProps) => {
82
64
  {...dataProps}
83
65
  {...htmlProps}
84
66
  className={classes}
85
- data-overlay-color={color}
86
67
  id={id}
87
- style={{
88
- ...(fullScreen ? {
89
- position: 'fixed',
90
- top: 0,
91
- left: 0,
92
- right: 0,
93
- bottom: 0,
94
- zIndex: 9999,
95
- '--overlay-color': `var(--${color})`,
96
- } : {}),
97
- ...dynamicInlineProps
98
- }}
68
+ style={dynamicInlineProps}
99
69
  >
100
70
  {isSizePercentage ?
101
71
  OverlayPercentage({
102
72
  children,
103
73
  color,
104
- gradient,
105
74
  position: getPosition(),
106
75
  scrollBarNone,
107
- size: getSize(),
76
+ size: getSize()
108
77
  }) : OverlayToken({
109
78
  children,
110
79
  color,
111
80
  dynamic: dynamic,
112
- gradient,
113
81
  position: getPosition(),
114
82
  scrollBarNone,
115
- size: getSize(),
83
+ size: getSize()
116
84
  })
117
85
  }
118
86
  </div>
@@ -1 +1,7 @@
1
- Overlays help shift focus by dimming or masking background content. This kit supports gradient and solid color modes, with adjustable opacity to suit the context.
1
+ Overlays optionally accept a `color`, which sets the "start" (opaque) color of a gradient mask. Because this overlay is intended to reveal underlying content, the "end" color is fixed to transparent.
2
+
3
+ The optional `layout` prop accepts the `position` and `size` of the overlay as a key:value pair.
4
+
5
+ The `position` key accepts `bottom` (default), `top`, `y` (for both top and bottom) `right`, `left`, or `x` (for both left and right), which sets the side(s) where the `color` overlay starts. The direction of the overlay is always toward the opposite side of the position. For example, the default position of `bottom` starts the overlay on the bottom edge of your container and extends it toward the opposite side: the top.
6
+
7
+ The `size` value is `full` (100%) by default, but accepts our [spacing tokens](https://playbook.powerapp.cloud/visual_guidelines/spacing) or a percentage value as a string, and literally translates to how much of the container is covered by the overlay(s).
@@ -1,15 +1,10 @@
1
1
  examples:
2
2
  react:
3
3
  - overlay_default: Default
4
- - overlay_gradient_opacity: Gradient & Opacity
5
- - overlay_color: Color
6
- - overlay_layout: Layout
7
4
  - overlay_multi_directional: Multi-directional
8
5
  - overlay_vertical_dynamic_multi_directional: Vertical Dynamic Multi-directional
9
6
  - overlay_toggle: Toggle
10
7
  - overlay_hide_scroll_bar: Hide Scroll Bar
11
- - overlay_fullscreen_opacity: Full Page Opacity
12
- - overlay_fullscreen_background: Full Page Using Background Color Tokens
13
8
 
14
9
  rails:
15
10
  - overlay_default: Default
@@ -1,10 +1,5 @@
1
1
  export { default as OverlayDefault } from './_overlay_default.jsx'
2
- export { default as OverlayGradientOpacity } from './_overlay_gradient_opacity.jsx'
3
- export { default as OverlayColor } from './_overlay_color.jsx'
4
- export { default as OverlayLayout } from './_overlay_layout.jsx'
5
2
  export { default as OverlayMultiDirectional } from './_overlay_multi_directional.jsx'
6
3
  export { default as OverlayToggle } from './_overlay_toggle.jsx'
7
4
  export { default as OverlayVerticalDynamicMultiDirectional } from './_overlay_vertical_dynamic_multi_directional.jsx'
8
5
  export { default as OverlayHideScrollBar } from './_overlay_hide_scroll_bar.jsx'
9
- export { default as OverlayFullscreenOpacity } from './_overlay_fullscreen_opacity.jsx'
10
- export { default as OverlayFullscreenBackground } from './_overlay_fullscreen_background.jsx'
@@ -71,46 +71,8 @@ test('should add overlay-hide-scrollbar class when scrollBarNone is true', () =>
71
71
  data: { testid: testId },
72
72
  scrollBarNone: true
73
73
  }
74
-
74
+
75
75
  render(<Overlay {...props} />)
76
76
  const kit = screen.getByTestId(testId)
77
77
  expect(kit).toHaveClass('overlay-hide-scrollbar')
78
78
  })
79
-
80
- test('should have no_gradient class if gradient prop is false', () => {
81
- const props = {
82
- children,
83
- data: { testid: testId },
84
- id: testId,
85
- gradient: false
86
- }
87
-
88
- render(<Overlay {...props} />)
89
- const kit = screen.getByTestId(testId)
90
- expect(kit).toHaveClass('no_gradient')
91
- })
92
-
93
- test('should not have no_gradient class if gradient is not passed', () => {
94
- const props = {
95
- children,
96
- data: { testid: testId },
97
- id: testId
98
- }
99
-
100
- render(<Overlay {...props} />)
101
- const kit = screen.getByTestId(testId)
102
- expect(kit).not.toHaveClass('no_gradient')
103
- })
104
-
105
- test('should have the correct opacity class if opacity prop is passed', () => {
106
- const props = {
107
- children,
108
- data: { testid: testId },
109
- id: testId,
110
- opacity: "opacity_5"
111
- }
112
-
113
- render(<Overlay {...props} />)
114
- const kit = screen.getByTestId(testId)
115
- expect(kit).toHaveClass('opacity_5')
116
- })
@@ -39,9 +39,6 @@ $flag-min-resolution: 192dpi;
39
39
  color: $charcoal;
40
40
  }
41
41
 
42
- .iti__country-list {
43
- min-width: $dropdown-min-width;
44
- }
45
42
  // iti-spacer-horizontal's default is 8px, or $space_xs
46
43
  .iti__country-list .iti__flag, .iti__country-name {
47
44
  margin-right: $space_xs;
@@ -230,16 +227,6 @@ $flag-min-resolution: 192dpi;
230
227
  .iti__dropdown-content {
231
228
  border-radius: $space_xs;
232
229
  border: 1px solid $border_dark !important;
233
- .iti__search-input {
234
- background-color: $bg_dark_card;
235
- &:hover {
236
- background-color: $bg_dark_card;
237
- }
238
- &:active,
239
- &:focus {
240
- background-color: $card_dark;
241
- }
242
- }
243
230
  }
244
231
 
245
232
  .iti__divider {
@@ -37,7 +37,6 @@ type PhoneNumberInputProps = {
37
37
  required?: boolean,
38
38
  value?: string,
39
39
  formatAsYouType?: boolean,
40
- countrySearch?: boolean,
41
40
  }
42
41
 
43
42
  enum ValidationError {
@@ -92,7 +91,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
92
91
  preferredCountries = [],
93
92
  value = "",
94
93
  formatAsYouType = false,
95
- countrySearch = false,
96
94
  } = props
97
95
 
98
96
  const ariaProps = buildAriaProps(aria)
@@ -244,7 +242,7 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
244
242
  autoInsertDialCode: false,
245
243
  initialCountry: initialCountry || fallbackCountry,
246
244
  onlyCountries,
247
- countrySearch: countrySearch,
245
+ countrySearch: false,
248
246
  fixDropdownWidth: false,
249
247
  formatAsYouType: formatAsYouType,
250
248
  hiddenInput: hiddenInputs ? () => ({
@@ -3,7 +3,6 @@ import React, { useEffect, useState } from "react";
3
3
  import Button from '../../pb_button/_button'
4
4
  import FixedConfirmationToast from '../../pb_fixed_confirmation_toast/_fixed_confirmation_toast'
5
5
  import PhoneNumberInput from '../../pb_phone_number_input/_phone_number_input'
6
- import Icon from '../../pb_icon/_icon'
7
6
 
8
7
  const PhoneNumberInputValidation = (props) => {
9
8
  const [formErrors, setFormErrors] = useState("");
@@ -30,12 +29,6 @@ const PhoneNumberInputValidation = (props) => {
30
29
  setShowFormErrors(formErrors.length > 0);
31
30
  }, [formErrors]);
32
31
 
33
- const error = (
34
- <>
35
- <Icon icon="warning" /> Missing phone number.
36
- </>
37
- )
38
-
39
32
  return (
40
33
  <form
41
34
  action=""
@@ -50,7 +43,7 @@ const PhoneNumberInputValidation = (props) => {
50
43
  />
51
44
  )}
52
45
  <PhoneNumberInput
53
- error={error}
46
+ error="Missing phone number."
54
47
  id="validation"
55
48
  initialCountry={countryCode}
56
49
  onChange={handleOnChange}
@@ -9,7 +9,6 @@ examples:
9
9
  - phone_number_input_clear_field: Clearing the Input Field
10
10
  - phone_number_input_access_input_element: Accessing the Input Element
11
11
  - phone_number_input_format: Format as You Type
12
- - phone_number_input_country_search: Country Search
13
12
 
14
13
  rails:
15
14
  - phone_number_input_default: Default
@@ -19,5 +18,4 @@ examples:
19
18
  - phone_number_input_validation: Form Validation
20
19
  - phone_number_input_format: Format as You Type
21
20
  - phone_number_input_hidden_inputs: Hidden Inputs
22
- - phone_number_input_country_search: Country Search
23
21
 
@@ -6,4 +6,3 @@ export { default as PhoneNumberInputValidation } from './_phone_number_input_val
6
6
  export { default as PhoneNumberInputClearField } from './_phone_number_input_clear_field'
7
7
  export { default as PhoneNumberInputAccessInputElement } from './_phone_number_input_access_input_element'
8
8
  export { default as PhoneNumberInputFormat } from './_phone_number_input_format'
9
- export { default as PhoneNumberInputCountrySearch } from './_phone_number_input_country_search'
@@ -25,8 +25,6 @@ module Playbook
25
25
  default: false
26
26
  prop :hidden_inputs, type: Playbook::Props::Boolean,
27
27
  default: false
28
- prop :country_search, type: Playbook::Props::Boolean,
29
- default: false
30
28
 
31
29
  def classname
32
30
  generate_classname("pb_phone_number_input")
@@ -47,7 +45,6 @@ module Playbook
47
45
  preferredCountries: preferred_countries,
48
46
  required: required,
49
47
  value: value,
50
- countrySearch: country_search,
51
48
  }
52
49
  end
53
50
  end