playbook_ui 15.8.0.pre.rc.1 → 16.0.0.pre.alpha.HFH3979Applydepwarningfixtoplaybook13635

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 (219) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -4
  3. data/app/pb_kits/playbook/pb_icon/icon.rb +6 -1
  4. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +7 -0
  5. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options.md +1 -1
  6. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_disabled.html.erb +135 -0
  7. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_disabled.jsx +147 -0
  8. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_disabled.md +1 -0
  9. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +2 -0
  10. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -0
  11. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx +402 -27
  12. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +1 -0
  13. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.html.erb +30 -0
  14. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx +1 -1
  15. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md +1 -1
  16. data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +1 -0
  17. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +51 -7
  18. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.rb +1 -0
  19. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +6 -1
  20. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +6 -1
  21. data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.test.jsx +1 -1
  22. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +6 -1
  23. data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.test.jsx +1 -1
  24. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +6 -1
  25. data/app/pb_kits/playbook/pb_pb_line_graph/pb_line_graph.test.jsx +1 -1
  26. data/app/pb_kits/playbook/pb_radio/_radio.scss +8 -0
  27. data/app/pb_kits/playbook/pb_table/docs/_sections.yml +68 -0
  28. data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +37 -50
  29. data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +38 -50
  30. data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +37 -50
  31. data/app/pb_kits/playbook/utilities/test/globalProps/borderRadius.test.js +33 -0
  32. data/app/pb_kits/playbook/utilities/test/globalProps/bottom.test.js +60 -0
  33. data/app/pb_kits/playbook/utilities/test/globalProps/cursor.test.js +42 -0
  34. data/app/pb_kits/playbook/utilities/test/globalProps/dark.test.js +33 -0
  35. data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +37 -51
  36. data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +44 -76
  37. data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +37 -50
  38. data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +35 -48
  39. data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +35 -48
  40. data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +37 -50
  41. data/app/pb_kits/playbook/utilities/test/globalProps/gap.test.js +87 -0
  42. data/app/pb_kits/playbook/utilities/test/globalProps/globalPropsTestHelper.js +373 -0
  43. data/app/pb_kits/playbook/utilities/test/globalProps/height.test.js +68 -0
  44. data/app/pb_kits/playbook/utilities/test/globalProps/htmlOptions.test.js +510 -0
  45. data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +37 -50
  46. data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +37 -50
  47. data/app/pb_kits/playbook/utilities/test/globalProps/left.test.js +60 -0
  48. data/app/pb_kits/playbook/utilities/test/globalProps/lineHeight.test.js +33 -0
  49. data/app/pb_kits/playbook/utilities/test/globalProps/margin.test.js +95 -0
  50. data/app/pb_kits/playbook/utilities/test/globalProps/numberSpacing.test.js +33 -0
  51. data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +36 -48
  52. data/app/pb_kits/playbook/utilities/test/globalProps/overflow.test.js +68 -0
  53. data/app/pb_kits/playbook/utilities/test/globalProps/padding.test.js +95 -0
  54. data/app/pb_kits/playbook/utilities/test/globalProps/position.test.js +33 -0
  55. data/app/pb_kits/playbook/utilities/test/globalProps/right.test.js +60 -0
  56. data/app/pb_kits/playbook/utilities/test/globalProps/shadow.test.js +33 -0
  57. data/app/pb_kits/playbook/utilities/test/globalProps/textAlign.test.js +41 -0
  58. data/app/pb_kits/playbook/utilities/test/globalProps/top.test.js +60 -0
  59. data/app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js +30 -18
  60. data/app/pb_kits/playbook/utilities/test/globalProps/verticalAlign.test.js +40 -0
  61. data/app/pb_kits/playbook/utilities/test/globalProps/width.test.js +66 -0
  62. data/app/pb_kits/playbook/utilities/test/globalProps/zIndex.test.js +50 -0
  63. data/dist/chunks/_pb_line_graph-hxi01lk7.js +1 -0
  64. data/dist/chunks/_typeahead-BgLnlhzP.js +1 -0
  65. data/dist/chunks/componentRegistry-DzmmLR2x.js +1 -0
  66. data/dist/chunks/globalProps-DgYwLYNx.js +6 -0
  67. data/dist/chunks/lib-NLxTo8OB.js +29 -0
  68. data/dist/chunks/vendor.js +4 -4
  69. data/dist/menu.yml +0 -29
  70. data/dist/playbook-rails-react-bindings.js +1 -1
  71. data/dist/playbook-rails.js +1 -1
  72. data/dist/playbook.css +1 -1
  73. data/lib/playbook/version.rb +2 -2
  74. metadata +34 -147
  75. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.scss +0 -6
  76. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +0 -196
  77. data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +0 -31
  78. data/app/pb_kits/playbook/pb_bar_graph/barGraphSettings.js +0 -32
  79. data/app/pb_kits/playbook/pb_bar_graph/barGraphTheme.ts +0 -106
  80. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.html.erb +0 -1
  81. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -98
  82. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.html.erb +0 -26
  83. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.jsx +0 -55
  84. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.md +0 -2
  85. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +0 -42
  86. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.md +0 -2
  87. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.html.erb +0 -26
  88. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +0 -55
  89. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.html.erb +0 -26
  90. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +0 -69
  91. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.md +0 -3
  92. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.html.erb +0 -58
  93. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +0 -64
  94. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.html.erb +0 -14
  95. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +0 -40
  96. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.html.erb +0 -15
  97. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.jsx +0 -48
  98. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.html.erb +0 -62
  99. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.jsx +0 -136
  100. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.md +0 -17
  101. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.html.erb +0 -23
  102. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.jsx +0 -52
  103. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.html.erb +0 -26
  104. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.jsx +0 -86
  105. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.md +0 -3
  106. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.html.erb +0 -20
  107. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.jsx +0 -46
  108. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.md +0 -2
  109. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.html.erb +0 -22
  110. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.jsx +0 -55
  111. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.md +0 -1
  112. data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +0 -1
  113. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +0 -28
  114. data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +0 -11
  115. data/app/pb_kits/playbook/pb_circle_chart/ChartsTypes.ts +0 -2
  116. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.scss +0 -16
  117. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +0 -228
  118. data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +0 -45
  119. data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +0 -88
  120. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.html.erb +0 -10
  121. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +0 -99
  122. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +0 -26
  123. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +0 -88
  124. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +0 -20
  125. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +0 -44
  126. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_rails.md +0 -2
  127. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +0 -2
  128. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +0 -20
  129. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +0 -43
  130. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +0 -5
  131. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +0 -19
  132. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +0 -38
  133. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.html.erb +0 -136
  134. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +0 -152
  135. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +0 -86
  136. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +0 -142
  137. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +0 -14
  138. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +0 -63
  139. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +0 -22
  140. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +0 -45
  141. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.html.erb +0 -37
  142. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +0 -61
  143. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.html.erb +0 -22
  144. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +0 -41
  145. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.html.erb +0 -38
  146. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +0 -55
  147. data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +0 -1
  148. data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +0 -26
  149. data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +0 -11
  150. data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +0 -104
  151. data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +0 -16
  152. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +0 -174
  153. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +0 -173
  154. data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +0 -20
  155. data/app/pb_kits/playbook/pb_gauge/_gauge.scss +0 -49
  156. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +0 -215
  157. data/app/pb_kits/playbook/pb_gauge/docs/_description.md +0 -1
  158. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.html.erb +0 -12
  159. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.jsx +0 -36
  160. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_rails.md +0 -2
  161. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_react.md +0 -2
  162. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.html.erb +0 -32
  163. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +0 -146
  164. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_rails.md +0 -1
  165. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_react.md +0 -1
  166. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb +0 -11
  167. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +0 -30
  168. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.html.erb +0 -12
  169. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +0 -36
  170. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb +0 -14
  171. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +0 -49
  172. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb +0 -15
  173. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +0 -62
  174. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +0 -76
  175. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb +0 -15
  176. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +0 -54
  177. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.md +0 -1
  178. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb +0 -27
  179. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +0 -80
  180. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.md +0 -2
  181. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb +0 -14
  182. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +0 -38
  183. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb +0 -29
  184. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +0 -72
  185. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units_react.md +0 -1
  186. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +0 -27
  187. data/app/pb_kits/playbook/pb_gauge/docs/index.js +0 -11
  188. data/app/pb_kits/playbook/pb_gauge/gauge.html.erb +0 -2
  189. data/app/pb_kits/playbook/pb_gauge/gauge.rb +0 -56
  190. data/app/pb_kits/playbook/pb_gauge/gauge.test.js +0 -35
  191. data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +0 -91
  192. data/app/pb_kits/playbook/pb_line_graph/_line_graph.scss +0 -3
  193. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +0 -166
  194. data/app/pb_kits/playbook/pb_line_graph/docs/_description.md +0 -1
  195. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.html.erb +0 -26
  196. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.jsx +0 -56
  197. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_rails.md +0 -2
  198. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_react.md +0 -3
  199. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.html.erb +0 -26
  200. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +0 -52
  201. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.html.erb +0 -26
  202. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +0 -70
  203. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.md +0 -3
  204. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.html.erb +0 -15
  205. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.jsx +0 -43
  206. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.html.erb +0 -16
  207. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.jsx +0 -49
  208. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.html.erb +0 -62
  209. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.jsx +0 -129
  210. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.md +0 -14
  211. data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -18
  212. data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -6
  213. data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +0 -52
  214. data/app/pb_kits/playbook/pb_line_graph/lineGraphSettings.js +0 -30
  215. data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +0 -125
  216. data/app/pb_kits/playbook/pb_line_graph/line_graph.html.erb +0 -1
  217. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +0 -93
  218. data/dist/chunks/_typeahead-D0GNUBXn.js +0 -6
  219. data/dist/chunks/lib-DxCgrqqG.js +0 -29
@@ -1,39 +1,414 @@
1
1
  import React from 'react'
2
- import { render, screen } from '../utilities/test-utils'
2
+ import { render, screen, fireEvent } from '../utilities/test-utils'
3
3
 
4
4
  import { MultiLevelSelect } from 'playbook-ui'
5
5
 
6
- const treeData = {
7
- label: 'search me',
8
- value: 'searchme',
9
- id:'default1',
10
- children: [
11
- {
12
- label: 'search me too',
13
- value: 'searchmetoo',
14
- id:'default2',
15
- children: [
16
- {
17
- label: 'No one can get me',
18
- value: 'anonymous',
19
- id:'default3',
20
- },
21
- ],
22
- },
23
- ],
24
- }
6
+ const treeData = [
7
+ {
8
+ label: 'Power Home Remodeling',
9
+ value: 'powerHomeRemodeling',
10
+ id: 'powerhome1',
11
+ expanded: true,
12
+ children: [
13
+ {
14
+ label: 'People',
15
+ value: 'people',
16
+ id: 'people1',
17
+ children: [
18
+ {
19
+ label: 'Talent Acquisition',
20
+ value: 'talentAcquisition',
21
+ id: 'talent1',
22
+ },
23
+ {
24
+ label: 'Business Affairs',
25
+ value: 'businessAffairs',
26
+ id: 'business1',
27
+ },
28
+ ],
29
+ },
30
+ {
31
+ label: 'Contact Center',
32
+ value: 'contactCenter',
33
+ id: 'contact1',
34
+ },
35
+ ],
36
+ },
37
+ ]
38
+
39
+ const treeDataWithDisabledOptions = [
40
+ {
41
+ label: 'Power Home Remodeling',
42
+ value: 'powerHomeRemodeling',
43
+ id: 'powerhome1',
44
+ expanded: true,
45
+ children: [
46
+ {
47
+ label: 'People',
48
+ value: 'people',
49
+ id: 'people1',
50
+ disabled: true,
51
+ },
52
+ {
53
+ label: 'Contact Center',
54
+ value: 'contactCenter',
55
+ id: 'contact1',
56
+ },
57
+ ],
58
+ },
59
+ ]
60
+
61
+ const treeDataWithDisabledParent = [
62
+ {
63
+ label: 'Power Home Remodeling',
64
+ value: 'powerHomeRemodeling',
65
+ id: 'powerhome1',
66
+ expanded: true,
67
+ disabled: true,
68
+ children: [
69
+ {
70
+ label: 'People',
71
+ value: 'people',
72
+ id: 'people1',
73
+ },
74
+ {
75
+ label: 'Contact Center',
76
+ value: 'contactCenter',
77
+ id: 'contact1',
78
+ },
79
+ ],
80
+ },
81
+ ]
25
82
 
26
83
  const testId = "multiselect-test"
27
- test('should render custom class', () => {
28
- render(
84
+
85
+ describe('MultiLevelSelect', () => {
86
+ test('should render custom class', () => {
87
+ render(
29
88
  <MultiLevelSelect
30
89
  className='custom-class'
31
- data={{ testid: testId}}
90
+ data={{ testid: testId }}
91
+ treeData={treeData}
92
+ />
93
+ )
94
+ const kit = screen.getByTestId(testId)
95
+ expect(kit).toHaveClass('custom-class')
96
+ })
97
+
98
+ test('should render with default multi variant', () => {
99
+ render(
100
+ <MultiLevelSelect
101
+ data={{ testid: testId }}
102
+ treeData={treeData}
103
+ />
104
+ )
105
+ const kit = screen.getByTestId(testId)
106
+ expect(kit).toHaveClass('pb_multi_level_select')
107
+ })
108
+
109
+ test('should render label when provided', () => {
110
+ render(
111
+ <MultiLevelSelect
112
+ data={{ testid: testId }}
113
+ label="Select Location"
114
+ treeData={treeData}
115
+ />
116
+ )
117
+ const kit = screen.getByTestId(testId)
118
+ expect(kit).toHaveTextContent('Select Location')
119
+ })
120
+
121
+ test('should render error message when provided', () => {
122
+ render(
123
+ <MultiLevelSelect
124
+ data={{ testid: testId }}
125
+ error="Please select an option"
126
+ treeData={treeData}
127
+ />
128
+ )
129
+ const kit = screen.getByTestId(testId)
130
+ expect(kit).toHaveTextContent('Please select an option')
131
+ expect(kit).toHaveClass('error')
132
+ })
133
+
134
+ test('should disable input when disabled prop is true', () => {
135
+ render(
136
+ <MultiLevelSelect
137
+ data={{ testid: testId }}
138
+ disabled
32
139
  treeData={treeData}
33
- />
34
- )
140
+ />
141
+ )
142
+ const kit = screen.getByTestId(testId)
143
+ const input = kit.querySelector('#multiselect_input')
144
+ expect(input).toBeDisabled()
145
+ })
146
+ })
35
147
 
36
- const kit = screen.getByTestId(testId)
37
- expect(kit).toHaveClass('custom-class')
148
+ describe('MultiLevelSelect multi variant', () => {
149
+ test('should render checkboxes for multi variant', () => {
150
+ render(
151
+ <MultiLevelSelect
152
+ data={{ testid: testId }}
153
+ treeData={treeData}
154
+ variant="multi"
155
+ />
156
+ )
157
+ const kit = screen.getByTestId(testId)
158
+ const input = kit.querySelector('#multiselect_input')
159
+ fireEvent.click(input)
160
+
161
+ const checkboxes = kit.querySelectorAll('input[type="checkbox"]')
162
+ expect(checkboxes.length).toBeGreaterThan(0)
163
+ })
164
+
165
+ test('should call onSelect when checkbox is clicked', () => {
166
+ const mockOnSelect = jest.fn()
167
+ render(
168
+ <MultiLevelSelect
169
+ data={{ testid: testId }}
170
+ onSelect={mockOnSelect}
171
+ treeData={treeData}
172
+ variant="multi"
173
+ />
174
+ )
175
+ const kit = screen.getByTestId(testId)
176
+ const input = kit.querySelector('#multiselect_input')
177
+ fireEvent.click(input)
178
+
179
+ const checkbox = kit.querySelector('input[type="checkbox"]')
180
+ fireEvent.click(checkbox)
181
+
182
+ expect(mockOnSelect).toHaveBeenCalled()
183
+ })
184
+
185
+ test('should render disabled checkbox inputs for disabled options', () => {
186
+ render(
187
+ <MultiLevelSelect
188
+ data={{ testid: testId }}
189
+ id="multi-disabled-test"
190
+ treeData={treeDataWithDisabledOptions}
191
+ variant="multi"
192
+ />
193
+ )
194
+ const kit = screen.getByTestId(testId)
195
+ const input = kit.querySelector('#multiselect_input')
196
+ fireEvent.click(input)
197
+
198
+ const disabledCheckbox = kit.querySelector('input[type="checkbox"][disabled]')
199
+ expect(disabledCheckbox).toBeInTheDocument()
200
+ })
38
201
  })
39
202
 
203
+ describe('MultiLevelSelect single variant', () => {
204
+ test('should render radio buttons for single variant', () => {
205
+ render(
206
+ <MultiLevelSelect
207
+ data={{ testid: testId }}
208
+ treeData={treeData}
209
+ variant="single"
210
+ />
211
+ )
212
+ const kit = screen.getByTestId(testId)
213
+ const input = kit.querySelector('#multiselect_input')
214
+ fireEvent.click(input)
215
+
216
+ const radios = kit.querySelectorAll('input[type="radio"]')
217
+ expect(radios.length).toBeGreaterThan(0)
218
+ })
219
+
220
+ test('should render disabled radio inputs for disabled options', () => {
221
+ render(
222
+ <MultiLevelSelect
223
+ data={{ testid: testId }}
224
+ id="single-disabled-test"
225
+ treeData={treeDataWithDisabledOptions}
226
+ variant="single"
227
+ />
228
+ )
229
+ const kit = screen.getByTestId(testId)
230
+ const input = kit.querySelector('#multiselect_input')
231
+ fireEvent.click(input)
232
+
233
+ const disabledRadio = kit.querySelector('input[type="radio"][disabled]')
234
+ expect(disabledRadio).toBeInTheDocument()
235
+ })
236
+
237
+ test('disabled options cannot be selected', () => {
238
+ const mockOnSelect = jest.fn()
239
+ render(
240
+ <MultiLevelSelect
241
+ data={{ testid: testId }}
242
+ id="single-disabled-click-test"
243
+ onSelect={mockOnSelect}
244
+ treeData={treeDataWithDisabledOptions}
245
+ variant="single"
246
+ />
247
+ )
248
+ const kit = screen.getByTestId(testId)
249
+ const input = kit.querySelector('#multiselect_input')
250
+ fireEvent.click(input)
251
+
252
+ const disabledRadio = kit.querySelector('input[type="radio"][disabled]')
253
+ fireEvent.click(disabledRadio)
254
+
255
+ expect(mockOnSelect).not.toHaveBeenCalled()
256
+ })
257
+
258
+ test('enabled options can be selected', () => {
259
+ const mockOnSelect = jest.fn()
260
+ render(
261
+ <MultiLevelSelect
262
+ data={{ testid: testId }}
263
+ id="single-enabled-click-test"
264
+ onSelect={mockOnSelect}
265
+ treeData={treeDataWithDisabledOptions}
266
+ variant="single"
267
+ />
268
+ )
269
+ const kit = screen.getByTestId(testId)
270
+ const input = kit.querySelector('#multiselect_input')
271
+ fireEvent.click(input)
272
+
273
+ const enabledRadio = kit.querySelector('input[type="radio"]:not([disabled])')
274
+ fireEvent.click(enabledRadio)
275
+
276
+ expect(mockOnSelect).toHaveBeenCalled()
277
+ })
278
+
279
+ test('should close dropdown after selection', () => {
280
+ render(
281
+ <MultiLevelSelect
282
+ data={{ testid: testId }}
283
+ treeData={treeDataWithDisabledOptions}
284
+ variant="single"
285
+ />
286
+ )
287
+ const kit = screen.getByTestId(testId)
288
+ const input = kit.querySelector('#multiselect_input')
289
+ fireEvent.click(input)
290
+
291
+ const enabledRadio = kit.querySelector('input[type="radio"]:not([disabled])')
292
+ fireEvent.click(enabledRadio)
293
+
294
+ const dropdownClosed = kit.querySelector('.dropdown_menu.close')
295
+ expect(dropdownClosed).toBeInTheDocument()
296
+ })
297
+
298
+ test('should update input value after selection', () => {
299
+ render(
300
+ <MultiLevelSelect
301
+ data={{ testid: testId }}
302
+ treeData={treeDataWithDisabledOptions}
303
+ variant="single"
304
+ />
305
+ )
306
+ const kit = screen.getByTestId(testId)
307
+ const input = kit.querySelector('#multiselect_input')
308
+ fireEvent.click(input)
309
+
310
+ const enabledRadio = kit.querySelector('input[type="radio"]:not([disabled])')
311
+ fireEvent.click(enabledRadio)
312
+
313
+ expect(input.value).toBe('Power Home Remodeling')
314
+ })
315
+ })
316
+
317
+ describe('MultiLevelSelect disabled parent behavior', () => {
318
+ test('children of disabled parent should also be disabled in single variant', () => {
319
+ render(
320
+ <MultiLevelSelect
321
+ data={{ testid: testId }}
322
+ treeData={treeDataWithDisabledParent}
323
+ variant="single"
324
+ />
325
+ )
326
+ const kit = screen.getByTestId(testId)
327
+ const input = kit.querySelector('#multiselect_input')
328
+ fireEvent.click(input)
329
+
330
+ const radios = kit.querySelectorAll('input[type="radio"]')
331
+ radios.forEach(radio => {
332
+ expect(radio).toBeDisabled()
333
+ })
334
+ })
335
+
336
+ test('children of disabled parent should also be disabled in multi variant', () => {
337
+ render(
338
+ <MultiLevelSelect
339
+ data={{ testid: testId }}
340
+ treeData={treeDataWithDisabledParent}
341
+ variant="multi"
342
+ />
343
+ )
344
+ const kit = screen.getByTestId(testId)
345
+ const input = kit.querySelector('#multiselect_input')
346
+ fireEvent.click(input)
347
+
348
+ const checkboxes = kit.querySelectorAll('input[type="checkbox"]')
349
+ checkboxes.forEach(checkbox => {
350
+ expect(checkbox).toBeDisabled()
351
+ })
352
+ })
353
+ })
354
+
355
+ describe('MultiLevelSelect onChange callback', () => {
356
+ test('should call onChange when selection changes in multi variant', () => {
357
+ const mockOnChange = jest.fn()
358
+ render(
359
+ <MultiLevelSelect
360
+ data={{ testid: testId }}
361
+ onChange={mockOnChange}
362
+ treeData={treeData}
363
+ variant="multi"
364
+ />
365
+ )
366
+ const kit = screen.getByTestId(testId)
367
+ const input = kit.querySelector('#multiselect_input')
368
+ fireEvent.click(input)
369
+
370
+ const checkbox = kit.querySelector('input[type="checkbox"]')
371
+ fireEvent.click(checkbox)
372
+
373
+ expect(mockOnChange).toHaveBeenCalled()
374
+ })
375
+
376
+ test('should call onChange when selection changes in single variant', () => {
377
+ const mockOnChange = jest.fn()
378
+ render(
379
+ <MultiLevelSelect
380
+ data={{ testid: testId }}
381
+ onChange={mockOnChange}
382
+ treeData={treeDataWithDisabledOptions}
383
+ variant="single"
384
+ />
385
+ )
386
+ const kit = screen.getByTestId(testId)
387
+ const input = kit.querySelector('#multiselect_input')
388
+ fireEvent.click(input)
389
+
390
+ const enabledRadio = kit.querySelector('input[type="radio"]:not([disabled])')
391
+ fireEvent.click(enabledRadio)
392
+
393
+ expect(mockOnChange).toHaveBeenCalled()
394
+ })
395
+ })
396
+
397
+ describe('MultiLevelSelect inputName prop', () => {
398
+ test('should use inputName for radio button name attribute', () => {
399
+ render(
400
+ <MultiLevelSelect
401
+ data={{ testid: testId }}
402
+ inputName="location_select"
403
+ treeData={treeData}
404
+ variant="single"
405
+ />
406
+ )
407
+ const kit = screen.getByTestId(testId)
408
+ const input = kit.querySelector('#multiselect_input')
409
+ fireEvent.click(input)
410
+
411
+ const radio = kit.querySelector('input[type="radio"]')
412
+ expect(radio).toHaveAttribute('name', 'location_select')
413
+ })
414
+ })
@@ -101,6 +101,7 @@ const classes = classnames(
101
101
  ) : (
102
102
  <Radio
103
103
  checked={item.checked}
104
+ disabled={item.disabled}
104
105
  id={`${item.id}-${item.label}`}
105
106
  label={item.label}
106
107
  name={inputName}
@@ -0,0 +1,30 @@
1
+ <%= pb_rails("multiple_users", props: {
2
+ with_tooltip: true,
3
+ users: [
4
+ {
5
+ name: "Patrick Welch",
6
+ image_url: "https://randomuser.me/api/portraits/men/9.jpg",
7
+ tooltip: "Patrick Welch - Online"
8
+ },
9
+ {
10
+ name: "Lucille Sanchez",
11
+ image_url: "https://randomuser.me/api/portraits/women/6.jpg",
12
+ tooltip: "Lucille Sanchez - Offline"
13
+ },
14
+ {
15
+ name: "Beverly Reyes",
16
+ image_url: "https://randomuser.me/api/portraits/women/74.jpg",
17
+ tooltip: "Beverly Reyes - Online"
18
+ },
19
+ {
20
+ name: "Keith Craig",
21
+ image_url: "https://randomuser.me/api/portraits/men/40.jpg",
22
+ tooltip: "Keith Craig - Away"
23
+ },
24
+ {
25
+ name: "Alicia Cooper",
26
+ image_url: "https://randomuser.me/api/portraits/women/46.jpg",
27
+ tooltip: "Alicia Cooper - Busy"
28
+ }
29
+ ]
30
+ }) %>
@@ -38,5 +38,5 @@ const MultipleUsersWithTooltip = (props) => {
38
38
  </div>
39
39
  )
40
40
  }
41
- ``
41
+
42
42
  export default MultipleUsersWithTooltip
@@ -1 +1 @@
1
- Use the `withTooltip` boolean prop to enable setting user-specific tooltip content via the `tooltip` property in the users array.
1
+ Use the `withTooltip` / `with_tooltip` boolean prop to enable setting user-specific tooltip content via the `tooltip` property in the users array.
@@ -4,6 +4,7 @@ examples:
4
4
  - multiple_users_default: Default
5
5
  - multiple_users_reverse: Reverse
6
6
  - multiple_users_size: Size
7
+ - multiple_users_with_tooltip: With Tooltip
7
8
 
8
9
 
9
10
  react:
@@ -1,11 +1,55 @@
1
1
  <%= pb_content_tag do %>
2
- <% object.users.take(object.display_count).each do |user| %>
3
- <%= pb_rails("avatar", props: user.merge({size: object.size, classname: "pb_multiple_users_item", dark: object.dark}) ) %>
4
- <% end %>
2
+ <% if object.with_tooltip %>
3
+ <% object.users.take(object.display_count).each_with_index do |user, index| %>
4
+ <% user_id = "multiple-users-#{object.object_id}-user-#{index}" %>
5
+ <div id="<%= user_id %>" class="pb_multiple_users_item">
6
+ <%= pb_rails("avatar", props: user.except(:tooltip).merge({size: object.size, dark: object.dark})) %>
7
+ </div>
8
+ <% end %>
9
+
10
+ <% if object.more_than_four %>
11
+ <% badge_id = "multiple-users-#{object.object_id}-badge" %>
12
+ <div id="<%= badge_id %>" class="pb_multiple_users_item multiple_users_badge_<%= object.size %><%= object.dark ? " dark" : "" %>">
13
+ <%= "+#{object.users.count - object.display_count}" %>
14
+ </div>
15
+ <% end %>
16
+
17
+ <% object.users.take(object.display_count).each_with_index do |user, index| %>
18
+ <% if user[:tooltip].present? %>
19
+ <% user_id = "multiple-users-#{object.object_id}-user-#{index}" %>
20
+ <%= pb_rails("tooltip", props: {
21
+ trigger_element_selector: "##{user_id}",
22
+ tooltip_id: "#{user_id}-tooltip",
23
+ position: "top",
24
+ z_index: "10"
25
+ }) do %>
26
+ <%= user[:tooltip] %>
27
+ <% end %>
28
+ <% end %>
29
+ <% end %>
30
+
31
+ <% if object.more_than_four %>
32
+ <% badge_id = "multiple-users-#{object.object_id}-badge" %>
33
+ <%= pb_rails("tooltip", props: {
34
+ trigger_element_selector: "##{badge_id}",
35
+ tooltip_id: "#{badge_id}-tooltip",
36
+ position: "top",
37
+ z_index: "10"
38
+ }) do %>
39
+ <% object.users.drop(object.display_count).each do |user| %>
40
+ <div><%= user[:tooltip] || user[:name] %></div>
41
+ <% end %>
42
+ <% end %>
43
+ <% end %>
44
+ <% else %>
45
+ <% object.users.take(object.display_count).each do |user| %>
46
+ <%= pb_rails("avatar", props: user.merge({size: object.size, classname: "pb_multiple_users_item", dark: object.dark})) %>
47
+ <% end %>
5
48
 
6
- <% if object.more_than_four %>
7
- <div class="pb_multiple_users_item multiple_users_badge_<%= object.size %><%= object.dark ? " dark" : "" %>">
8
- <%= "+#{object.users.count - object.display_count}" %>
9
- </div>
49
+ <% if object.more_than_four %>
50
+ <div class="pb_multiple_users_item multiple_users_badge_<%= object.size %><%= object.dark ? " dark" : "" %>">
51
+ <%= "+#{object.users.count - object.display_count}" %>
52
+ </div>
53
+ <% end %>
10
54
  <% end %>
11
55
  <% end %>
@@ -8,6 +8,7 @@ module Playbook
8
8
  values: %w[xxs xs],
9
9
  default: "xs"
10
10
  prop :users, type: Playbook::Props::HashArray, required: true
11
+ prop :with_tooltip, type: Playbook::Props::Boolean, default: false
11
12
 
12
13
  def more_than_four
13
14
  users.count > 4
@@ -2,4 +2,9 @@
2
2
 
3
3
  This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
4
4
 
5
- See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
5
+ See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
6
+
7
+ **NOTE**: All chart kits are available through a separate entrypoint to keep Highcharts optional. Import them using:
8
+ ```javascript
9
+ import { PbBarGraph } from 'playbook-ui/charts'
10
+ ```
@@ -2,4 +2,9 @@
2
2
 
3
3
  This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
4
4
 
5
- See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
5
+ See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
6
+
7
+ **NOTE**: All chart kits are available through a separate entrypoint to keep Highcharts optional. Import them using:
8
+ ```javascript
9
+ import { PbCircleChart } from 'playbook-ui/charts'
10
+ ```
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { render, screen } from '../utilities/test-utils'
3
3
 
4
- import { PbCircleChart } from 'playbook-ui'
4
+ import PbCircleChart from './_pb_circle_chart'
5
5
 
6
6
  beforeEach(() => {
7
7
  // Silences error logs within the test suite.
@@ -2,4 +2,9 @@
2
2
 
3
3
  This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
4
4
 
5
- See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
5
+ See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
6
+
7
+ **NOTE**: All chart kits are available through a separate entrypoint to keep Highcharts optional. Import them using:
8
+ ```javascript
9
+ import { PbGaugeChart } from 'playbook-ui/charts'
10
+ ```
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { render, screen } from '../utilities/test-utils'
3
3
 
4
- import { PbGaugeChart } from 'playbook-ui'
4
+ import PbGaugeChart from './_pb_gauge_chart'
5
5
 
6
6
  beforeEach(() => {
7
7
  // Silences error logs within the test suite.
@@ -2,4 +2,9 @@
2
2
 
3
3
  This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
4
4
 
5
- See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
5
+ See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
6
+
7
+ **NOTE**: All chart kits are available through a separate entrypoint to keep Highcharts optional. Import them using:
8
+ ```javascript
9
+ import { PbLineGraph } from 'playbook-ui/charts'
10
+ ```
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { render, screen } from '../utilities/test-utils'
3
3
 
4
- import { PbLineGraph } from 'playbook-ui'
4
+ import PbLineGraph from './_pb_line_graph'
5
5
 
6
6
  beforeEach(() => {
7
7
  // Silences error logs within the test suite.
@@ -13,6 +13,10 @@
13
13
  display: inline-flex;
14
14
  cursor: pointer;
15
15
 
16
+ &:has(input:disabled) {
17
+ cursor: not-allowed;
18
+ }
19
+
16
20
  .pb_radio_button {
17
21
  width: 22px;
18
22
  min-width: 22px;
@@ -84,6 +88,10 @@
84
88
  .pb_radio_kit.dark.error.vertical,
85
89
  .pb_radio_kit_vertical.dark,
86
90
  .pb_radio_kit_vertical.dark.error {
91
+ &:has(input:disabled) {
92
+ cursor: not-allowed;
93
+ }
94
+
87
95
  .pb_radio_button {
88
96
  border-color: $border_dark;
89
97
  }