playbook_ui 15.0.0 → 15.1.0.pre.alpha.PLAY2468phonenuminputvalidation10803

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 (204) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +3 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +24 -11
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +7 -7
  5. data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +7 -2
  6. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +67 -13
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +2 -2
  8. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +0 -1
  9. data/app/pb_kits/playbook/pb_card/_card.scss +12 -4
  10. data/app/pb_kits/playbook/pb_card/_card.tsx +3 -3
  11. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +10 -0
  12. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.html.erb +3 -0
  13. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.jsx +8 -0
  14. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +2 -0
  15. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -0
  16. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +1 -0
  17. data/app/pb_kits/playbook/pb_contact/_contact.tsx +5 -0
  18. data/app/pb_kits/playbook/pb_contact/contact.rb +4 -0
  19. data/app/pb_kits/playbook/pb_contact/contact.test.js +21 -1
  20. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +16 -1
  21. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +15 -0
  22. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.md +5 -0
  23. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.html.erb +6 -0
  24. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.jsx +6 -0
  25. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +6 -4
  26. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +48 -4
  27. data/app/pb_kits/playbook/pb_dialog/_close_icon.tsx +5 -1
  28. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +6 -8
  29. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -1
  30. data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +2 -2
  31. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +9 -0
  32. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +3 -3
  33. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
  34. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
  35. data/app/pb_kits/playbook/pb_form/pb_form_validation.js +40 -8
  36. data/app/pb_kits/playbook/pb_icon/_icon.tsx +13 -2
  37. data/app/pb_kits/playbook/pb_icon/icon.rb +9 -1
  38. data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +1 -0
  39. data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +2 -1
  40. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.html.erb +1 -1
  41. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +3 -1
  42. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.html.erb +5 -0
  43. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.jsx +24 -0
  44. data/app/pb_kits/playbook/pb_loading_inline/docs/example.yml +2 -0
  45. data/app/pb_kits/playbook/pb_loading_inline/docs/index.js +1 -0
  46. data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +1 -1
  47. data/app/pb_kits/playbook/pb_loading_inline/loading_inline.rb +11 -0
  48. data/app/pb_kits/playbook/pb_nav/_item.tsx +19 -5
  49. data/app/pb_kits/playbook/pb_nav/_nav.scss +27 -0
  50. data/app/pb_kits/playbook/pb_nav/_nav.test.js +16 -0
  51. data/app/pb_kits/playbook/pb_nav/_nav.tsx +5 -0
  52. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_extendedunderline.html.erb +6 -0
  53. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_extendedunderline.jsx +39 -0
  54. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_extendedunderline.md +1 -0
  55. data/app/pb_kits/playbook/pb_nav/docs/example.yml +2 -0
  56. data/app/pb_kits/playbook/pb_nav/docs/index.js +2 -1
  57. data/app/pb_kits/playbook/pb_nav/item.html.erb +6 -2
  58. data/app/pb_kits/playbook/pb_nav/nav.rb +6 -1
  59. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.html.erb +3 -3
  60. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.html.erb +3 -3
  61. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.html.erb +3 -3
  62. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.html.erb +3 -3
  63. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.html.erb +3 -3
  64. data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.scss +0 -0
  65. data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.tsx +62 -0
  66. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.html.erb +35 -0
  67. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +49 -0
  68. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_rails.md +1 -0
  69. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_react.md +2 -0
  70. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.html.erb +38 -0
  71. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +51 -0
  72. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.html.erb +46 -0
  73. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +62 -0
  74. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.md +3 -0
  75. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.html.erb +47 -0
  76. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +60 -0
  77. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.html.erb +25 -0
  78. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +36 -0
  79. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +44 -0
  80. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +100 -0
  81. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +126 -0
  82. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.html.erb +32 -0
  83. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +48 -0
  84. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.html.erb +68 -0
  85. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +81 -0
  86. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.html.erb +31 -0
  87. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +42 -0
  88. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.md +2 -0
  89. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.html.erb +35 -0
  90. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +51 -0
  91. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/example.yml +27 -0
  92. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/index.js +11 -0
  93. data/app/pb_kits/playbook/pb_pb_bar_graph/pbBarGraphTheme.ts +106 -0
  94. data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.html.erb +1 -0
  95. data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.rb +28 -0
  96. data/app/pb_kits/playbook/pb_pb_bar_graph/pbbargraph.test.jsx +31 -0
  97. data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.scss +3 -0
  98. data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.tsx +62 -0
  99. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.html.erb +31 -0
  100. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +81 -0
  101. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.html.erb +25 -0
  102. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +40 -0
  103. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.md +5 -0
  104. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.html.erb +27 -0
  105. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +39 -0
  106. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +5 -0
  107. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.html.erb +93 -0
  108. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +131 -0
  109. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.md +14 -0
  110. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.html.erb +42 -0
  111. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +58 -0
  112. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.html.erb +24 -0
  113. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +38 -0
  114. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.html.erb +22 -0
  115. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +33 -0
  116. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.html.erb +118 -0
  117. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +144 -0
  118. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +60 -0
  119. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.html.erb +24 -0
  120. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +42 -0
  121. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.html.erb +38 -0
  122. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +52 -0
  123. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/example.yml +29 -0
  124. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/index.js +11 -0
  125. data/app/pb_kits/playbook/pb_pb_circle_chart/pbCircleChartTheme.ts +88 -0
  126. data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.html.erb +1 -0
  127. data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.rb +28 -0
  128. data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.test.jsx +51 -0
  129. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +51 -2
  130. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +2 -2
  131. data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +13 -5
  132. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.html.erb +23 -0
  133. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.jsx +45 -7
  134. data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +4 -1
  135. data/app/pb_kits/playbook/pb_section_separator/section_separator.test.js +165 -0
  136. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +3 -0
  137. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.html.erb +41 -0
  138. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.jsx +80 -0
  139. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.md +1 -0
  140. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +3 -0
  141. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  142. data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -3
  143. data/app/pb_kits/playbook/pb_text_input/text_input.test.js +38 -0
  144. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +24 -8
  145. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.html.erb +0 -10
  146. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.jsx +0 -9
  147. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.md +1 -0
  148. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.html.erb +3 -17
  149. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +0 -15
  150. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.md +1 -0
  151. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +0 -2
  152. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.jsx +0 -2
  153. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.md +5 -0
  154. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.html.erb +12 -0
  155. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.jsx +25 -0
  156. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.md +1 -0
  157. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.html.erb +4 -0
  158. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.jsx +17 -0
  159. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.md +1 -0
  160. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.html.erb +18 -0
  161. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.jsx +44 -0
  162. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.md +1 -0
  163. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.html.erb +0 -14
  164. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.jsx +0 -14
  165. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.md +1 -0
  166. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.html.erb +0 -4
  167. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.jsx +0 -4
  168. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.jsx +0 -1
  169. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.md +5 -0
  170. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.html.erb +16 -0
  171. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.jsx +30 -0
  172. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.md +1 -0
  173. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.html.erb +16 -0
  174. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.jsx +30 -0
  175. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.md +1 -0
  176. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.html.erb +26 -0
  177. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.jsx +41 -0
  178. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.md +1 -0
  179. data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +18 -6
  180. data/app/pb_kits/playbook/pb_timestamp/docs/index.js +6 -0
  181. data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +29 -7
  182. data/app/pb_kits/playbook/pb_timestamp/timestamp.test.js +69 -4
  183. data/dist/chunks/{_line_graph-CIyKqNGy.js → _line_graph-Bkn-wx30.js} +1 -1
  184. data/dist/chunks/_typeahead-DkRYiut7.js +6 -0
  185. data/dist/chunks/_weekday_stacked-BUjWQnqn.js +37 -0
  186. data/dist/chunks/componentRegistry-DzmmLR2x.js +1 -0
  187. data/dist/chunks/{lib-DgtxnJqa.js → lib-QZuu1ltS.js} +2 -2
  188. data/dist/chunks/pb_form_validation-B4uRmBwC.js +1 -0
  189. data/dist/chunks/vendor.js +1 -1
  190. data/dist/menu.yml +15 -1
  191. data/dist/playbook-doc.js +2 -2
  192. data/dist/playbook-rails-react-bindings.js +1 -1
  193. data/dist/playbook-rails.js +1 -1
  194. data/dist/playbook.css +1 -1
  195. data/lib/playbook/engine.rb +0 -1
  196. data/lib/playbook/forms/builder/form_field_builder.rb +37 -2
  197. data/lib/playbook/kit_base.rb +23 -2
  198. data/lib/playbook/version.rb +2 -2
  199. metadata +111 -28
  200. data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +0 -65
  201. data/app/pb_kits/playbook/pb_timestamp/docs/_time_stamp_default.md +0 -1
  202. data/dist/chunks/_typeahead-B-mDRLxH.js +0 -6
  203. data/dist/chunks/_weekday_stacked-B_lp1Spt.js +0 -37
  204. data/dist/chunks/pb_form_validation-_NsOWfBS.js +0 -1
@@ -0,0 +1,60 @@
1
+ import React, { useState } from "react";
2
+ import { PbCircleChart, Button } from "playbook-ui";
3
+
4
+ const chartData = [
5
+ {
6
+ name: "Waiting for Calls",
7
+ y: 41,
8
+ },
9
+ {
10
+ name: "On Call",
11
+ y: 49,
12
+ },
13
+ {
14
+ name: "After Call",
15
+ y: 10,
16
+ },
17
+ ];
18
+
19
+ const chartData2 = [
20
+ {
21
+ name: "Waiting for Calls",
22
+ y: 48,
23
+ },
24
+ {
25
+ name: "On Call",
26
+ y: 12,
27
+ },
28
+ {
29
+ name: "After Call",
30
+ y: 140,
31
+ },
32
+ ];
33
+
34
+
35
+ const PbCircleChartLiveData = (props) => {
36
+
37
+ const [data, setData] = useState(chartData);
38
+
39
+ const updateValue = () => {
40
+ setData(chartData2)
41
+ }
42
+ const chartOptions = {
43
+ series: [{ data: data }],
44
+ }
45
+
46
+ return (
47
+ <div>
48
+ <Button
49
+ onClick={updateValue}
50
+ text="Update Value"
51
+ />
52
+ <PbCircleChart
53
+ options={chartOptions}
54
+ {...props}
55
+ />
56
+ </div>
57
+ );
58
+ };
59
+
60
+ export default PbCircleChartLiveData;
@@ -0,0 +1,24 @@
1
+ <% data = [
2
+ {
3
+ name: "Waiting for Calls",
4
+ y: 41,
5
+ },
6
+ {
7
+ name: "On Call",
8
+ y: 49,
9
+ },
10
+ {
11
+ name: "After Call",
12
+ y: 10,
13
+ },
14
+ ] %>
15
+
16
+ <% chart_options = {
17
+ series: [{
18
+ data: data,
19
+ innerSize: '100%',
20
+ borderWidth: '20',
21
+ }],
22
+ } %>
23
+
24
+ <%= pb_rails("pb_circle_chart", props: { options: chart_options }) %>
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import { PbCircleChart } from "playbook-ui";
3
+
4
+ const data= [
5
+ {
6
+ name: "Waiting for Calls",
7
+ y: 41,
8
+ },
9
+ {
10
+ name: "On Call",
11
+ y: 49,
12
+ },
13
+ {
14
+ name: "After Call",
15
+ y: 10,
16
+ },
17
+ ]
18
+
19
+
20
+ const PbCircleChartRounded = (props) => {
21
+ const chartOptions = {
22
+ series: [{ data: data }],
23
+ plotOptions: {
24
+ pie: {
25
+ borderColor: null,
26
+ borderWidth: 20,
27
+ innerSize: '100%',
28
+ },
29
+ },
30
+ };
31
+
32
+ return (
33
+ <div>
34
+ <PbCircleChart
35
+ options={chartOptions}
36
+ {...props}
37
+ />
38
+ </div>
39
+ );
40
+ };
41
+
42
+ export default PbCircleChartRounded;
@@ -0,0 +1,38 @@
1
+ <% data = [
2
+ {
3
+ name: 'Facebook',
4
+ y: 2498,
5
+ },
6
+ {
7
+ name: 'YouTube',
8
+ y: 2000,
9
+ },
10
+ {
11
+ name: 'WhatsApp',
12
+ y: 2000,
13
+ },
14
+ {
15
+ name: 'Facebook Messenger',
16
+ y: 1300,
17
+ },
18
+ {
19
+ name: 'WeChat',
20
+ y: 1165,
21
+ },
22
+ {
23
+ name: 'Instagram',
24
+ y: 1000,
25
+ },
26
+ {
27
+ name: 'Tik Tok',
28
+ y: 800,
29
+ },
30
+ ] %>
31
+
32
+ <% chart_options = {
33
+ series: [{ data: data }],
34
+ title: { text: "Active Users on Social Media" },
35
+ } %>
36
+
37
+
38
+ <%= pb_rails("pb_circle_chart", props: { options: chart_options }) %>
@@ -0,0 +1,52 @@
1
+ import React from "react";
2
+ import { PbCircleChart } from "playbook-ui";
3
+
4
+ const data= [
5
+ {
6
+ name: 'Facebook',
7
+ y: 2498,
8
+ },
9
+ {
10
+ name: 'YouTube',
11
+ y: 2000,
12
+ },
13
+ {
14
+ name: 'WhatsApp',
15
+ y: 2000,
16
+ },
17
+ {
18
+ name: 'Facebook Messenger',
19
+ y: 1300,
20
+ },
21
+ {
22
+ name: 'WeChat',
23
+ y: 1165,
24
+ },
25
+ {
26
+ name: 'Instagram',
27
+ y: 1000,
28
+ },
29
+ {
30
+ name: 'Tik Tok',
31
+ y: 800,
32
+ },
33
+ ]
34
+
35
+
36
+ const PbCircleChartWithTitle = (props) => {
37
+ const chartOptions = {
38
+ title: { text: "Active Users on Social Media" },
39
+ series: [{ data: data }],
40
+ };
41
+
42
+ return (
43
+ <div>
44
+ <PbCircleChart
45
+ options={chartOptions}
46
+ {...props}
47
+ />
48
+ </div>
49
+ );
50
+ };
51
+
52
+ export default PbCircleChartWithTitle;
@@ -0,0 +1,29 @@
1
+ examples:
2
+
3
+ rails:
4
+ - pb_circle_chart_default: Default
5
+ - pb_circle_chart_rounded: Rounded Corners
6
+ - pb_circle_chart_block_content: Accepts Any Block
7
+ - pb_circle_chart_color_overrides: Color Overrides
8
+ - pb_circle_chart_data_with_labels: Data with Labels
9
+ - pb_circle_chart_data_with_legend: Data with Legend
10
+ - pb_circle_chart_data_legend_position: Legend Position
11
+ - pb_circle_chart_with_title: With Title
12
+ - pb_circle_chart_inner_sizes: Inner Circle Size Options
13
+ - pb_circle_chart_custom_tooltip: Tooltip Customization
14
+
15
+
16
+ react:
17
+ - pb_circle_chart_default: Default
18
+ - pb_circle_chart_live_data: Live Data
19
+ - pb_circle_chart_rounded: Rounded Corners
20
+ - pb_circle_chart_block_content: Accepts Any Block
21
+ - pb_circle_chart_color_overrides: Color Overrides
22
+ - pb_circle_chart_data_with_labels: Data with Labels
23
+ - pb_circle_chart_data_with_legend: Data with Legend
24
+ - pb_circle_chart_data_legend_position: Legend Position
25
+ - pb_circle_chart_with_title: With Title
26
+ - pb_circle_chart_inner_sizes: Inner Circle Size Options
27
+ - pb_circle_chart_custom_tooltip: Tooltip Customization
28
+
29
+
@@ -0,0 +1,11 @@
1
+ export { default as PbCircleChartDefault } from './_pb_circle_chart_default.jsx'
2
+ export { default as PbCircleChartLiveData } from './_pb_circle_chart_live_data.jsx'
3
+ export { default as PbCircleChartRounded } from './_pb_circle_chart_rounded.jsx'
4
+ export { default as PbCircleChartBlockContent } from './_pb_circle_chart_block_content.jsx'
5
+ export { default as PbCircleChartColorOverrides } from './_pb_circle_chart_color_overrides.jsx'
6
+ export { default as PbCircleChartDataWithLabels } from './_pb_circle_chart_data_with_labels.jsx'
7
+ export { default as PbCircleChartDataWithLegend } from './_pb_circle_chart_data_with_legend.jsx'
8
+ export { default as PbCircleChartDataLegendPosition } from './_pb_circle_chart_data_legend_position.jsx'
9
+ export { default as PbCircleChartWithTitle } from './_pb_circle_chart_with_title.jsx'
10
+ export { default as PbCircleChartInnerSizes } from './_pb_circle_chart_inner_sizes.jsx'
11
+ export { default as PbCircleChartCustomTooltip } from './_pb_circle_chart_custom_tooltip.jsx'
@@ -0,0 +1,88 @@
1
+ import colors from '../tokens/exports/_colors.module.scss'
2
+ import typography from '../tokens/exports/_typography.module.scss'
3
+
4
+ const pbCircleChartTheme = {
5
+ title: {
6
+ text: "",
7
+ style: {
8
+ color: colors.text_lt_default,
9
+ fontFamily: typography.font_family_base,
10
+ fontWeight: typography.bold,
11
+ fontSize: typography.heading_3,
12
+ },
13
+ },
14
+ chart: {
15
+ type: "pie",
16
+ },
17
+ tooltip: {
18
+ backgroundColor: {
19
+ linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
20
+ stops: [
21
+ [0, colors.bg_dark],
22
+ [1, colors.bg_dark],
23
+ ],
24
+ },
25
+ pointFormat:
26
+ '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' +
27
+ "<b>{point.y}</b>",
28
+ followPointer: true,
29
+ shadow: false,
30
+ borderWidth: 0,
31
+ borderRadius: 10,
32
+ style: {
33
+ fontFamily: typography.font_family_base,
34
+ color: colors.text_dk_default,
35
+ fontWeight: typography.regular,
36
+ fontSize: typography.text_smaller,
37
+ },
38
+ },
39
+ plotOptions: {
40
+ pie: {
41
+ dataLabels: {
42
+ enabled: false,
43
+ connectorShape: "straight",
44
+ connectorWidth: 3,
45
+ format: "<div>{point.name}</div>",
46
+ style: {
47
+ fontFamily: typography.font_family_base,
48
+ fontSize: typography.text_smaller,
49
+ color: colors.text_lt_light,
50
+ fontWeight: typography.regular,
51
+ textOutline: '2px $white',
52
+ },
53
+ },
54
+ innerSize: '50%',
55
+ borderColor: "",
56
+ borderWidth: null as number | null,
57
+ colors: [
58
+ colors.data_1,
59
+ colors.data_2,
60
+ colors.data_3,
61
+ colors.data_4,
62
+ colors.data_5,
63
+ colors.data_6,
64
+ colors.data_7,
65
+ ],
66
+ },
67
+ },
68
+ legend: {
69
+ layout: 'horizontal',
70
+ align: 'center',
71
+ verticalAlign: 'bottom',
72
+ itemStyle: {
73
+ fontFamily: typography.font_family_base,
74
+ color: colors.text_lt_light,
75
+ fontWeight: typography.regular,
76
+ fontSize: typography.text_smaller,
77
+ },
78
+ itemHoverStyle: {
79
+ color: colors.text_lt_default,
80
+ },
81
+ itemHiddenStyle: {
82
+ color: colors.text_lt_lighter,
83
+ },
84
+ },
85
+ credits: { enabled: false }
86
+ }
87
+
88
+ export default pbCircleChartTheme;
@@ -0,0 +1 @@
1
+ <%= react_component('PbCircleChart', object.react_props) %>
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbPbCircleChart
5
+ class PbCircleChart < ::Playbook::KitBase
6
+ prop :options, default: {}
7
+ prop :container_props, default: {}
8
+
9
+ def react_props
10
+ {
11
+ options: options,
12
+ containerProps: container_props_hash,
13
+ }
14
+ end
15
+
16
+ def container_props_hash
17
+ container_props.merge({
18
+ id: id,
19
+ className: classname,
20
+ }).compact
21
+ end
22
+
23
+ def classname
24
+ generate_classname("pb_pb_circle_chart")
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,51 @@
1
+ import React from 'react'
2
+ import { render, screen } from '../utilities/test-utils'
3
+
4
+ import { PbCircleChart } from 'playbook-ui'
5
+
6
+ beforeEach(() => {
7
+ // Silences error logs within the test suite.
8
+ jest.spyOn(console, 'error');
9
+ jest.spyOn(console, 'warn');
10
+ console.error.mockImplementation(() => {});
11
+ console.warn.mockImplementation(() => {});
12
+ });
13
+
14
+ afterEach(() => {
15
+ console.error.mockRestore();
16
+ console.warn.mockRestore();
17
+ });
18
+
19
+ const chartOptions = {
20
+ series: [
21
+ {
22
+ data: [
23
+ {
24
+ name: "Waiting for Calls",
25
+ y: 41,
26
+ },
27
+ {
28
+ name: "On Call",
29
+ y: 49,
30
+ },
31
+ {
32
+ name: "After Call",
33
+ y: 10,
34
+ },
35
+ ],
36
+ },
37
+ ],
38
+ };
39
+
40
+ const testId = 'pbcirclechart1';
41
+
42
+ test('Kit to exist', () => {
43
+ render(
44
+ <PbCircleChart
45
+ data={{testid: testId}}
46
+ options={chartOptions}
47
+ />
48
+ )
49
+ expect(screen.getByTestId(testId)).toBeInTheDocument()
50
+ })
51
+
@@ -110,18 +110,35 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
110
110
 
111
111
  const inputRef = useRef<HTMLInputElement | null>(null)
112
112
  const itiRef = useRef<any>(null);
113
+ const wrapperRef = useRef<HTMLDivElement | null>(null); // Add wrapper ref
113
114
  const [inputValue, setInputValue] = useState(value)
114
115
  const [error, setError] = useState(props.error)
115
116
  const [dropDownIsOpen, setDropDownIsOpen] = useState(false)
116
117
  const [selectedData, setSelectedData] = useState()
117
118
  const [hasTyped, setHasTyped] = useState(false)
118
119
 
120
+ // Function to update validation state on the wrapper element
121
+ // Only applies when input is required
122
+ const updateValidationState = (hasError: boolean) => {
123
+ if (wrapperRef.current && required) {
124
+ if (hasError) {
125
+ wrapperRef.current.setAttribute('data-pb-phone-validation-error', 'true')
126
+ } else {
127
+ wrapperRef.current.removeAttribute('data-pb-phone-validation-error')
128
+ }
129
+ }
130
+ }
131
+
119
132
  useEffect(() => {
120
- if ((error ?? '').length > 0) {
133
+ const hasError = (error ?? '').length > 0
134
+ if (hasError) {
121
135
  onValidate(false)
122
136
  } else {
123
137
  onValidate(true)
124
138
  }
139
+
140
+ // Update validation state whenever error changes
141
+ updateValidationState(hasError)
125
142
  }, [error, onValidate])
126
143
 
127
144
  /*
@@ -135,6 +152,10 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
135
152
  setInputValue("")
136
153
  setError("")
137
154
  setHasTyped(false)
155
+ // Only clear validation state if field was required
156
+ if (required) {
157
+ updateValidationState(false)
158
+ }
138
159
  },
139
160
  inputNode() {
140
161
  return inputRef.current
@@ -164,6 +185,13 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
164
185
 
165
186
  const validateTooShortNumber = (itiInit: any) => {
166
187
  if (!itiInit) return
188
+
189
+ // If field is empty, don't show "too short" error
190
+ if (!inputValue || inputValue.trim() === '') {
191
+ setError('')
192
+ return false
193
+ }
194
+
167
195
  if (itiInit.getValidationError() === ValidationError.TooShort) {
168
196
  return showFormattedError('too short')
169
197
  } else {
@@ -212,8 +240,26 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
212
240
  }
213
241
  }
214
242
 
243
+ // Validation for required empty fields
244
+ const validateRequiredField = () => {
245
+ if (required && (!inputValue || inputValue.trim() === '')) {
246
+ setError('Missing phone number')
247
+ return true
248
+ }
249
+ return false
250
+ }
215
251
 
216
252
  const validateErrors = () => {
253
+ // If field is empty, only show required field error if applicable
254
+ if (!inputValue || inputValue.trim() === '') {
255
+ if (validateRequiredField()) return
256
+ // Clear any existing errors if field is empty and not required
257
+ if (!required) {
258
+ setError('')
259
+ }
260
+ return
261
+ }
262
+
217
263
  if (!hasTyped && !error) return
218
264
 
219
265
  if (itiRef.current) isValid(itiRef.current.isValidNumber())
@@ -310,7 +356,10 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
310
356
  value: inputValue
311
357
  }
312
358
 
313
- let wrapperProps: Record<string, unknown> = { className: classes }
359
+ let wrapperProps: Record<string, unknown> = {
360
+ className: classes,
361
+ ref: wrapperRef // Add ref to wrapper
362
+ }
314
363
 
315
364
  if (!isEmpty(aria)) textInputProps = {...textInputProps, ...ariaProps}
316
365
  if (!isEmpty(data)) wrapperProps = {...wrapperProps, ...dataProps}
@@ -13,8 +13,8 @@
13
13
  <script>
14
14
  document.addEventListener('DOMContentLoaded', () => {
15
15
  function handleButtonClick() {
16
- const editorContainer = [...document.querySelectorAll('[data-react-props]')]
17
- .find(element => element.getAttribute('data-react-props')?.includes('"id":"content-preview-editor"'))
16
+ const editorContainer = [...document.querySelectorAll('[data-pb-react-props]')]
17
+ .find(element => element.getAttribute('data-pb-react-props')?.includes('"id":"content-preview-editor"'))
18
18
 
19
19
  const editorElement = editorContainer?.querySelector('trix-editor')
20
20
  const inputId = editorElement?.getAttribute('input')
@@ -53,10 +53,13 @@ $section_colors_dark: (
53
53
  .pb_section_separator_vertical {
54
54
  margin-left: $space_xs;
55
55
  margin-right: $space_xs;
56
+ flex-direction: column;
56
57
  &::before {
57
- display: none;
58
+ flex: 1;
59
+ @include section_separator_vertical(false);
58
60
  }
59
61
  &::after {
62
+ flex: 1;
60
63
  @include section_separator_vertical(false);
61
64
  }
62
65
  }
@@ -87,7 +90,7 @@ $section_colors_dark: (
87
90
  background: none;
88
91
  }
89
92
  &.pb_section_separator_vertical {
90
- &::after {
93
+ &::before, &::after {
91
94
  border: 1px dashed $color_value;
92
95
  background: none;
93
96
  }
@@ -106,7 +109,7 @@ $section_colors_dark: (
106
109
  }
107
110
 
108
111
  &.pb_section_separator_vertical {
109
- &::after {
112
+ &::before, &::after {
110
113
  @include section_separator_vertical(true);
111
114
  }
112
115
  }
@@ -115,6 +118,11 @@ $section_colors_dark: (
115
118
  &::before, &::after {
116
119
  @include section_separator_dashed(true);
117
120
  }
121
+ &.pb_section_separator_vertical {
122
+ &::before, &::after {
123
+ @include section_separator_dashed(true);
124
+ }
125
+ }
118
126
  }
119
127
  }
120
128
 
@@ -126,7 +134,7 @@ $section_colors_dark: (
126
134
  }
127
135
 
128
136
  &.pb_section_separator_vertical {
129
- &::after {
137
+ &::before, &::after {
130
138
  @include section_separator_vertical(false);
131
139
  background: $color_value;
132
140
  }
@@ -138,7 +146,7 @@ $section_colors_dark: (
138
146
  background: none;
139
147
  }
140
148
  &.pb_section_separator_vertical {
141
- &::after {
149
+ &::before, &::after {
142
150
  border: 1px dashed $color_value;
143
151
  background: none;
144
152
  }
@@ -11,4 +11,27 @@
11
11
  padding_right: "xs"
12
12
  }) %>
13
13
  <% end %>
14
+ <% end %>
15
+
16
+ <%= pb_rails("flex", props: { classname: "flex-container", margin_top: "lg", vertical: "stretch" }) do %>
17
+ <%= pb_rails("body", props: { classname: "flex-item" }) do %>
18
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
19
+ <% end %>
20
+ <%= pb_rails("section_separator", props: { orientation: "vertical" }) do %>
21
+ <%= pb_rails("card", props: {
22
+ border_radius: "rounded",
23
+ justify_content: "center",
24
+ padding: "none"
25
+ }) do %>
26
+ <%= pb_rails("caption", props: {
27
+ text: "TODAY",
28
+ size: "xs",
29
+ padding_left: "xs",
30
+ padding_right: "xs"
31
+ }) %>
32
+ <% end %>
33
+ <% end %>
34
+ <%= pb_rails("body", props: { classname: "flex-item" }) do %>
35
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
36
+ <% end %>
14
37
  <% end %>