playbook_ui 15.3.0.pre.rc.5 → 15.3.0.pre.rc.7

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 (68) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +2 -0
  3. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +2 -2
  4. data/app/pb_kits/playbook/pb_dropdown/index.js +1 -1
  5. data/app/pb_kits/playbook/pb_icon/_icon.tsx +2 -1
  6. data/app/pb_kits/playbook/pb_icon/icon.rb +2 -1
  7. data/app/pb_kits/playbook/pb_list/item.html.erb +1 -1
  8. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +3 -0
  9. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +3 -0
  10. data/app/pb_kits/playbook/pb_pb_gauge_chart/_pb_gauge_chart.scss +3 -0
  11. data/app/pb_kits/playbook/pb_pb_gauge_chart/_pb_gauge_chart.tsx +69 -0
  12. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +3 -0
  13. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.html.erb +12 -0
  14. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.jsx +24 -0
  15. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.md +5 -0
  16. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.html.erb +45 -0
  17. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.jsx +119 -0
  18. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.md +1 -0
  19. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.html.erb +5 -0
  20. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.jsx +17 -0
  21. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_disable_animation.html.erb +12 -0
  22. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_disable_animation.jsx +24 -0
  23. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.html.erb +23 -0
  24. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.jsx +37 -0
  25. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.html.erb +40 -0
  26. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.jsx +56 -0
  27. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_live_data.jsx +64 -0
  28. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.html.erb +27 -0
  29. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.jsx +40 -0
  30. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.md +1 -0
  31. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_sizing.html.erb +19 -0
  32. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_sizing.jsx +65 -0
  33. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_sizing.md +3 -0
  34. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_title.html.erb +14 -0
  35. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_title.jsx +27 -0
  36. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.html.erb +39 -0
  37. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.jsx +58 -0
  38. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.md +1 -0
  39. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/example.yml +29 -0
  40. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/index.js +11 -0
  41. data/app/pb_kits/playbook/pb_pb_gauge_chart/pbGaugeGraphTheme.ts +91 -0
  42. data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.html.erb +1 -0
  43. data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.rb +25 -0
  44. data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.test.jsx +80 -0
  45. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +1 -1
  46. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +25 -6
  47. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.html.erb +2 -2
  48. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +1 -1
  49. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +35 -1
  50. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +71 -2
  51. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_options.html.erb +36 -0
  52. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_options.md +1 -0
  53. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_value.jsx +41 -0
  54. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_value.md +1 -0
  55. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  56. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
  57. data/dist/chunks/{_line_graph-B5YOK4R1.js → _line_graph-D5MBnrO9.js} +1 -1
  58. data/dist/chunks/_typeahead-BjYBazGq.js +6 -0
  59. data/dist/chunks/{_weekday_stacked-6WTeYQx9.js → _weekday_stacked-DtBUku82.js} +1 -1
  60. data/dist/chunks/vendor.js +1 -1
  61. data/dist/menu.yml +6 -0
  62. data/dist/playbook-doc.js +2 -2
  63. data/dist/playbook-rails-react-bindings.js +1 -1
  64. data/dist/playbook-rails.js +1 -1
  65. data/lib/playbook/pagination_renderer.rb +2 -2
  66. data/lib/playbook/version.rb +1 -1
  67. metadata +46 -5
  68. data/dist/chunks/_typeahead-QuljSdso.js +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a10aa2c1a72a04076e8102d684e0d1111ebb06b8dcd8f18e4b487adb5936715
4
- data.tar.gz: 61dd1d1cb0ebd44fbad5a310cb963cf558da10c852f32d7f9a8ee25598e975e3
3
+ metadata.gz: 34ba06be9734051d4a626b27aef7c10fd87031ea96146b7e84a2bb88bf228e24
4
+ data.tar.gz: 87a07d1e661e9b87d04061800858c71334d0f1afb3db434665bdf71ffdae6448
5
5
  SHA512:
6
- metadata.gz: 3b8d6b5e3cb5d744e5b1bdadc19991e70c72cb90935957dfe37c98d3c6137c4b8a1e8566aa4ff998ab5de69eaa0cdfb86a3af3fbd26b00d81877bdbf3417e367
7
- data.tar.gz: 87e6389f1b4f1fa674b675cbe7bca091efdde128bce369bc889635adebe2b96faf07c4ce18bf35bcd26ffe922add9d3d7515cfaf09e669af3ec121b8b1f158a6
6
+ metadata.gz: 28f45334fc6977a46c98b3532d5e5d87fab74a9c2e669c8ab0861eaf88ee6e500ff59f81fe365d7b5f70890ad6698d450377d335678be5df323c7e627211f9c4
7
+ data.tar.gz: a32d256d5a5a04669c6bbcd9b4c7b641f200ed1baaa96d544aaf033112ee4bb9db9343b855a2f28443f045dad3b1d5c69332941731bc635269ba5d6532280105
@@ -1,3 +1,4 @@
1
+
1
2
  @import 'pb_advanced_table/advanced_table';
2
3
  @import 'pb_avatar/avatar';
3
4
  @import 'pb_background/background';
@@ -70,6 +71,7 @@
70
71
  @import 'pb_passphrase/passphrase';
71
72
  @import 'pb_pb_bar_graph/pb_bar_graph';
72
73
  @import 'pb_pb_circle_chart/pb_circle_chart';
74
+ @import 'pb_pb_gauge_chart/pb_gauge_chart';
73
75
  @import 'pb_pb_line_graph/pb_line_graph';
74
76
  @import 'pb_person/person';
75
77
  @import 'pb_person_contact/person_contact';
@@ -32,9 +32,9 @@ exports[`html structure is correct 1`] = `
32
32
  class="pb_custom_icon svg-inline--fa svg_lg svg_fw"
33
33
  color="currentColor"
34
34
  fill="none"
35
- height="1.5em"
35
+ height="auto"
36
36
  viewBox="0 0 30 25"
37
- width="1em"
37
+ width="auto"
38
38
  xmlns="http://www.w3.org/2000/svg"
39
39
  >
40
40
  <path
@@ -522,7 +522,7 @@ export default class PbDropdown extends PbEnhancedElement {
522
522
  closeIcon.className = "pb_form_pill_close";
523
523
  closeIcon.innerHTML = `<svg class="pb_custom_icon svg-inline--fa svg_${
524
524
  this.formPillProps.size === "small" ? "xs" : "sm"
525
- } svg_fw" xmlns="http://www.w3.org/2000/svg" width="1em" viewBox="0 0 31 25"><path fill="currentColor" d="M23.0762 6.77734L17.4512 12.4023L23.0293 17.9805C23.498 18.4023 23.498 19.1055 23.0293 19.5273C22.6074 19.9961 21.9043 19.9961 21.4824 19.5273L15.8574 13.9492L10.2793 19.5273C9.85742 19.9961 9.1543 19.9961 8.73242 19.5273C8.26367 19.1055 8.26367 18.4023 8.73242 17.9336L14.3105 12.3555L8.73242 6.77734C8.26367 6.35547 8.26367 5.65234 8.73242 5.18359C9.1543 4.76172 9.85742 4.76172 10.3262 5.18359L15.9043 10.8086L21.4824 5.23047C21.9043 4.76172 22.6074 4.76172 23.0762 5.23047C23.498 5.65234 23.498 6.35547 23.0762 6.77734Z"/></svg>`;
525
+ } svg_fw" xmlns="http://www.w3.org/2000/svg" width="auto" height="auto" viewBox="0 0 31 25"><path fill="currentColor" d="M23.0762 6.77734L17.4512 12.4023L23.0293 17.9805C23.498 18.4023 23.498 19.1055 23.0293 19.5273C22.6074 19.9961 21.9043 19.9961 21.4824 19.5273L15.8574 13.9492L10.2793 19.5273C9.85742 19.9961 9.1543 19.9961 8.73242 19.5273C8.26367 19.1055 8.26367 18.4023 8.73242 17.9336L14.3105 12.3555L8.73242 6.77734C8.26367 6.35547 8.26367 5.65234 8.73242 5.18359C9.1543 4.76172 9.85742 4.76172 10.3262 5.18359L15.9043 10.8086L21.4824 5.23047C21.9043 4.76172 22.6074 4.76172 23.0762 5.23047C23.498 5.65234 23.498 6.35547 23.0762 6.77734Z"/></svg>`;
526
526
  pill.appendChild(closeIcon);
527
527
 
528
528
  closeIcon.addEventListener("click", (e) => {
@@ -235,7 +235,8 @@ const Icon = (props: IconProps) => {
235
235
  ...htmlProps,
236
236
  className: classes,
237
237
  id,
238
- width: '1em',
238
+ width: 'auto',
239
+ height: 'auto',
239
240
  ...(props.tabIndex !== undefined && { tabIndex }),
240
241
  })
241
242
  }
@@ -110,7 +110,8 @@ module Playbook
110
110
  svg["class"] = %w[pb_custom_icon svg-inline--fa].concat([object.custom_icon_classname]).join(" ")
111
111
  svg["id"] = object.id
112
112
  svg["data"] = object.data
113
- svg["width"] = "1em"
113
+ svg["height"] = "auto"
114
+ svg["width"] = "auto"
114
115
  svg["tabindex"] = object.tabindex
115
116
  fill_color = object.color || "currentColor"
116
117
  doc.at_css("path")["fill"] = fill_color
@@ -11,7 +11,7 @@
11
11
  <% if object.drag_handle %>
12
12
  <span style="vertical-align: middle;">
13
13
  <%= pb_rails("body") do %>
14
- <svg width="14em" viewBox="0 0 31 25" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="pb_custom_icon svg-inline--fa vertical_align_middle svg_fw"><path d="M12.904 6.355a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm0 7.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm4.5-13.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm-1.5 9a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5z" fill="#242B42"></path></svg>
14
+ <svg width="auto" height="auto" viewBox="0 0 31 25" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="pb_custom_icon svg-inline--fa vertical_align_middle svg_fw"><path d="M12.904 6.355a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm0 7.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm4.5-13.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm-1.5 9a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5z" fill="#242B42"></path></svg>
15
15
  <% end %>
16
16
  </span>
17
17
  <% end %>
@@ -0,0 +1,3 @@
1
+ This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, 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.
2
+
3
+ See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
@@ -0,0 +1,3 @@
1
+ This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, 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.
2
+
3
+ See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
@@ -0,0 +1,3 @@
1
+ .pb_pb_gauge_chart {
2
+
3
+ }
@@ -0,0 +1,69 @@
1
+
2
+ import React, { useMemo } from 'react'
3
+ import classnames from 'classnames'
4
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
+ import Highcharts from "highcharts"
6
+ import HighchartsReact from "highcharts-react-official"
7
+ import pbGaugeGraphTheme from './pbGaugeGraphTheme'
8
+ import highchartsMore from "highcharts/highcharts-more";
9
+ import solidGauge from "highcharts/modules/solid-gauge";
10
+ import { globalProps } from '../utilities/globalProps'
11
+
12
+ type PbGaugeChartProps = {
13
+ aria?: { [key: string]: string },
14
+ className?: string,
15
+ data?: { [key: string]: string },
16
+ htmlOptions?: { [key: string]: string | number | boolean | (() => void) | ((arg?: Event) => void) },
17
+ id?: string,
18
+ ref?: React.RefObject<any>,
19
+ options: Record<string, unknown>
20
+ }
21
+
22
+ const PbGaugeChart = (props: PbGaugeChartProps) => {
23
+ const {
24
+ aria = {},
25
+ className,
26
+ data = {},
27
+ htmlOptions = {},
28
+ id,
29
+ ref,
30
+ options = {},
31
+ } = props
32
+
33
+ const ariaProps = buildAriaProps(aria)
34
+ const dataProps = buildDataProps(data)
35
+ const htmlProps = buildHtmlProps(htmlOptions)
36
+ const classes = classnames(buildCss('pb_pb_gauge_chart'), globalProps(props), className)
37
+
38
+ const mergedOptions = useMemo(() => {
39
+ if (!options || typeof options !== "object") {
40
+ // eslint-disable-next-line no-console
41
+ console.error("❌ Invalid options passed to <PbLineGraph />", options)
42
+ return {}
43
+ }
44
+
45
+ return Highcharts.merge({}, pbGaugeGraphTheme, options)
46
+ }, [options])
47
+
48
+ highchartsMore(Highcharts);
49
+ solidGauge(Highcharts);
50
+
51
+ return (
52
+ <div>
53
+ <HighchartsReact
54
+ containerProps={{
55
+ className: classnames(classes),
56
+ id: id,
57
+ ref: ref,
58
+ ...ariaProps,
59
+ ...dataProps,
60
+ ...htmlProps
61
+ }}
62
+ highcharts={Highcharts}
63
+ options={mergedOptions}
64
+ />
65
+ </div>
66
+ )
67
+ }
68
+
69
+ export default PbGaugeChart
@@ -0,0 +1,3 @@
1
+ This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, 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.
2
+
3
+ See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
@@ -0,0 +1,12 @@
1
+ <% data = [{ name: "Name", y: 67 }] %>
2
+
3
+ <% chart_options = {
4
+ series: [{ data: data }],
5
+ plotOptions: {
6
+ solidgauge: {
7
+ borderColor: '#00C4D7',
8
+ }
9
+ },
10
+ } %>
11
+
12
+ <%= pb_rails("pb_gauge_chart", props: { options: chart_options }) %>
@@ -0,0 +1,24 @@
1
+ import React from 'react'
2
+ import PbGaugeChart from '../../pb_pb_gauge_chart/_pb_gauge_chart'
3
+ import { colors } from 'playbook-ui'
4
+
5
+ const data = [{ name: "Name", y: 67 }]
6
+
7
+ const chartOptions = {
8
+ series: [{ data: data }],
9
+ plotOptions: {
10
+ solidgauge: {
11
+ borderColor: colors.data_7,
12
+ }
13
+ },
14
+ };
15
+ const PbGaugeChartColor = (props) => (
16
+ <div>
17
+ <PbGaugeChart
18
+ options={chartOptions}
19
+ {...props}
20
+ />
21
+ </div>
22
+ )
23
+
24
+ export default PbGaugeChartColor
@@ -0,0 +1,5 @@
1
+ Highcharts allows for any custom colors to be used. Custom data colors allow for color customization to match the needs of business requirements.
2
+
3
+ For React, pass the prop `plotOptions.solidgauge.borderColor` with a Playbook token like `colors.` + `data_1 | data_2 | data_3 | data_4 | data_5 | data_6 | data_7 | data_8`. HEX colors are also available `eg: #CA0095`
4
+
5
+ For Rails, the prop `plotOptions.solidgauge.borderColor` can only be used with HEX values as shown.
@@ -0,0 +1,45 @@
1
+ <% chart_options = {
2
+ series:[{data:[{ name: "Name", y: 10 }]}],
3
+ chart: {
4
+ height: "150",
5
+ },
6
+ plotOptions: {
7
+ series: {
8
+ animation: false,
9
+ },
10
+ solidgauge: {
11
+ dataLabels: {
12
+ format:
13
+ '<span class="fix">{y:,f}</span>' +
14
+ '<span style="fill: #687887; font-size: 27px;">%</span>',
15
+ },
16
+ },
17
+ },
18
+ } %>
19
+
20
+ <%= pb_rails("flex", props: {wrap: true, padding: "xl", gap: "sm"}) do %>
21
+ <%= pb_rails("flex/flex_item", props: {flex: 1, grow: true }) do %>
22
+ <%= pb_rails("card", props: {max_width: "xs", padding: "md", }) do %>
23
+ <%= pb_rails("title", props: {padding_bottom: "sm", size: 4, text: "Abandoned Calls" })%>
24
+ <%= pb_rails("flex", props: {align: "stretch"}) do %>
25
+ <%= pb_rails("flex", props: {margin_right: "sm", orientation: "column"}) do %>
26
+ <%= pb_rails("body", props: {color: "light", padding_bottom: "sm",text: "Total Abandoned"}) %>
27
+ <%= pb_rails("flex", props: {align: "baseline", padding_bottom: "sx"}) do %>
28
+ <%= pb_rails("title", props: {size: 1, text: "39"})%>
29
+ <%= pb_rails("title", props: {color: "light", size: 3, text: "calls"}) %>
30
+ <% end %>
31
+ <%= pb_rails("caption", props: {size: "xs", text: "of 390" }) %>
32
+ <%end %>
33
+ <%= pb_rails("section_separator", props: {align_self: "stretch", margin_right: "sm", orientation: "vertical" }) %>
34
+ <%= pb_rails("flex", props: {orientation: "column", wrap: true}) do %>
35
+ <%= pb_rails("body", props: {color: "light", text: "% Abandoned"}) %>
36
+ <%= pb_rails("flex", props: {wrap: true}) do %>
37
+ <%= pb_rails("flex/flex_item", props: {fixed_size: "150px", overflow: "hidden", shrink: true}) do %>
38
+ <%= pb_rails("pb_gauge_chart", props: { options: chart_options }) %>
39
+ <% end %>
40
+ <% end %>
41
+ <% end %>
42
+ <%end %>
43
+ <% end %>
44
+ <% end %>
45
+ <% end %>
@@ -0,0 +1,119 @@
1
+ import React from 'react'
2
+ import PbGaugeChart from '../../pb_pb_gauge_chart/_pb_gauge_chart'
3
+ import Flex from '../../pb_flex/_flex'
4
+ import FlexItem from '../../pb_flex/_flex_item'
5
+ import Card from '../../pb_card/_card'
6
+ import Caption from '../../pb_caption/_caption'
7
+ import Body from '../../pb_body/_body'
8
+ import SectionSeparator from '../../pb_section_separator/_section_separator'
9
+ import Title from '../../pb_title/_title'
10
+ import { colors, typography } from 'playbook-ui'
11
+
12
+ const data = [{ name: "Name", y: 10 }];
13
+
14
+ const chartOptions = {
15
+ series: [{ data: data }],
16
+ chart: {
17
+ height: "150",
18
+ },
19
+ plotOptions: {
20
+ series: {
21
+ animation: false,
22
+ },
23
+ solidgauge: {
24
+ dataLabels: {
25
+ format:
26
+ `<span class="fix">{y:,f}</span>` +
27
+ `<span style="fill: ${colors.text_lt_light}; font-size: ${typography.text_larger};">%</span>`,
28
+ },
29
+ },
30
+ },
31
+ };
32
+
33
+ const PbGaugeChartComplex = (props) => (
34
+ <Flex
35
+ gap="sm"
36
+ padding="xl"
37
+ wrap
38
+ >
39
+ <FlexItem
40
+ flex={1}
41
+ grow
42
+ >
43
+ <Card
44
+ maxWidth="xs"
45
+ padding="md"
46
+ >
47
+ <Title
48
+ paddingBottom="sm"
49
+ size={4}
50
+ text="Abandoned Calls"
51
+ />
52
+ <Flex
53
+ align="stretch"
54
+ >
55
+ <Flex
56
+ marginRight="sm"
57
+ orientation="column"
58
+ >
59
+ <Body
60
+ color="light"
61
+ paddingBottom="sm"
62
+ text="Total Abandoned"
63
+ />
64
+ <Flex
65
+ align="baseline"
66
+ paddingBottom="xs"
67
+ >
68
+ <Title
69
+ size={1}
70
+ text="39"
71
+ />
72
+ <Title
73
+ color="light"
74
+ size={3}
75
+ text="calls"
76
+ />
77
+ </Flex>
78
+ <Caption
79
+ size="xs"
80
+ text="of 390"
81
+ />
82
+ </Flex>
83
+
84
+ <SectionSeparator
85
+ alignSelf="stretch"
86
+ marginRight="sm"
87
+ orientation="vertical"
88
+ />
89
+
90
+ <Flex
91
+ orientation="column"
92
+ wrap
93
+ >
94
+ <Body
95
+ color="light"
96
+ text="% Abandoned"
97
+ />
98
+ <Flex
99
+ wrap
100
+ >
101
+ <FlexItem
102
+ fixedSize="150px"
103
+ overflow="hidden"
104
+ shrink
105
+ >
106
+ <PbGaugeChart
107
+ options={chartOptions}
108
+ {...props}
109
+ />
110
+ </FlexItem>
111
+ </Flex>
112
+ </Flex>
113
+ </Flex>
114
+ </Card>
115
+ </FlexItem>
116
+ </Flex>
117
+ )
118
+
119
+ export default PbGaugeChartComplex
@@ -0,0 +1 @@
1
+ We are able to wrap the Highcharts Gauge kit within Playbook kits (such as Flex and Card components).
@@ -0,0 +1,5 @@
1
+ <% chart_options = {
2
+ series:[{data:[{ name: "Name", y: 45 }]}]
3
+ } %>
4
+
5
+ <%= pb_rails("pb_gauge_chart", props: { options: chart_options }) %>
@@ -0,0 +1,17 @@
1
+ import React from 'react'
2
+ import PbGaugeChart from '../../pb_pb_gauge_chart/_pb_gauge_chart'
3
+
4
+ const chartOptions = {
5
+ series:[{data:[{ name: "Name", y: 45 }]}]
6
+ }
7
+
8
+ const PbGaugeChartDefault = (props) => (
9
+ <div>
10
+ <PbGaugeChart
11
+ options={chartOptions}
12
+ {...props}
13
+ />
14
+ </div>
15
+ )
16
+
17
+ export default PbGaugeChartDefault
@@ -0,0 +1,12 @@
1
+ <% data = [{ name: "Participants", y: 84 }] %>
2
+
3
+ <% chart_options = {
4
+ series: [{ data: data }],
5
+ plotOptions: {
6
+ series: {
7
+ animation: false,
8
+ },
9
+ },
10
+ } %>
11
+
12
+ <%= pb_rails("pb_gauge_chart", props: { options: chart_options }) %>
@@ -0,0 +1,24 @@
1
+ import React from 'react'
2
+ import PbGaugeChart from '../../pb_pb_gauge_chart/_pb_gauge_chart'
3
+
4
+ const data = [{ name: "Participants", y: 84 }]
5
+
6
+ const chartOptions = {
7
+ series: [{ data: data }],
8
+ plotOptions: {
9
+ series: {
10
+ animation: false,
11
+ },
12
+ },
13
+ };
14
+
15
+ const PbGaugeChartDisableAnimation = (props) => (
16
+ <div>
17
+ <PbGaugeChart
18
+ options={chartOptions}
19
+ {...props}
20
+ />
21
+ </div>
22
+ )
23
+
24
+ export default PbGaugeChartDisableAnimation
@@ -0,0 +1,23 @@
1
+ <% data = [{ name: "Capacity", y: 75 }] %>
2
+
3
+ <% chart_options = {
4
+ title: {
5
+ text: "Seating Capacity",
6
+ },
7
+ series: [{ data: data }],
8
+ pane: {
9
+ startAngle: 0,
10
+ endAngle: 360,
11
+ },
12
+ plotOptions: {
13
+ solidgauge: {
14
+ dataLabels: {
15
+ format:
16
+ '<span class="fix">{y:,f}</span>' +
17
+ '<span style="fill: #687887; font-size: 27px;">%</span>',
18
+ },
19
+ },
20
+ },
21
+ } %>
22
+
23
+ <%= pb_rails("pb_gauge_chart", props: { options: chart_options }) %>
@@ -0,0 +1,37 @@
1
+ import React from 'react'
2
+ import PbGaugeChart from '../../pb_pb_gauge_chart/_pb_gauge_chart'
3
+ import { colors, typography } from 'playbook-ui'
4
+
5
+ const data = [{ name: "Capacity", y: 75 }]
6
+
7
+ const chartOptions = {
8
+ title: {
9
+ text: "Seating Capacity",
10
+ },
11
+ series: [{ data: data }],
12
+ pane: {
13
+ startAngle: 0,
14
+ endAngle: 360,
15
+ },
16
+ plotOptions: {
17
+ solidgauge: {
18
+ dataLabels: {
19
+ format:
20
+ `<span class="fix">{y:,f}</span>` +
21
+ `<span style="fill: ${colors.text_lt_light}; font-size: ${typography.text_larger};">%</span>`,
22
+ },
23
+ },
24
+ },
25
+ };
26
+
27
+
28
+ const PbGaugeChartFullCircle = (props) => (
29
+ <div>
30
+ <PbGaugeChart
31
+ options={chartOptions}
32
+ {...props}
33
+ />
34
+ </div>
35
+ )
36
+
37
+ export default PbGaugeChartFullCircle
@@ -0,0 +1,40 @@
1
+ <% chart_options = {
2
+ title: {
3
+ text: "Fixed Height in Pixels",
4
+ },
5
+ chart: {
6
+ height: "400",
7
+ },
8
+ series: [{ data: [{ name: "Pixels", y: 400 }] }],
9
+ plotOptions: {
10
+ solidgauge: {
11
+ dataLabels: {
12
+ format:
13
+ '<span class="fix">{y:,f}</span>' +
14
+ '<span style="fill: #687887; font-size: 27px;">px</span>',
15
+ },
16
+ },
17
+ },
18
+ } %>
19
+
20
+ <% chart_options_1 = {
21
+ title: {
22
+ text: "Height as Percentage of Width",
23
+ },
24
+ chart: {
25
+ height: "45%",
26
+ },
27
+ series: [{ data: [{ name: "Percentage", y: 45 }] }],
28
+ plotOptions: {
29
+ solidgauge: {
30
+ dataLabels: {
31
+ format:
32
+ '<span class="fix">{y:,f}</span>' +
33
+ '<span style="fill: #687887; font-size: 27px;">%</span>',
34
+ },
35
+ },
36
+ },
37
+ } %>
38
+
39
+ <%= pb_rails("pb_gauge_chart", props: { options: chart_options }) %>
40
+ <%= pb_rails("pb_gauge_chart", props: { options: chart_options_1 }) %>
@@ -0,0 +1,56 @@
1
+ import React from 'react'
2
+ import PbGaugeChart from '../../pb_pb_gauge_chart/_pb_gauge_chart'
3
+ import { colors, typography } from 'playbook-ui'
4
+
5
+ const chartOptions = {
6
+ title: {
7
+ text: "Fixed Height in Pixels",
8
+ },
9
+ chart: {
10
+ height: "400",
11
+ },
12
+ series: [{ data: [{ name: "Pixels", y: 400 }] }],
13
+ plotOptions: {
14
+ solidgauge: {
15
+ dataLabels: {
16
+ format:
17
+ `<span class="fix">{y:,f}</span>` +
18
+ `<span style="fill: ${colors.text_lt_light}; font-size: ${typography.text_larger};">px</span>`,
19
+ },
20
+ },
21
+ },
22
+ };
23
+
24
+ const chartOptions2 = {
25
+ title: {
26
+ text: "Height as Percentage of Width",
27
+ },
28
+ chart: {
29
+ height: "45%",
30
+ },
31
+ series: [{ data: [{ name: "Percentage", y: 45 }] }],
32
+ plotOptions: {
33
+ solidgauge: {
34
+ dataLabels: {
35
+ format:
36
+ `<span class="fix">{y:,f}</span>` +
37
+ `<span style="fill: ${colors.text_lt_light}; font-size: ${typography.text_larger};">%</span>`,
38
+ },
39
+ },
40
+ },
41
+ };
42
+
43
+ const PbGaugeChartHeight = (props) => (
44
+ <div>
45
+ <PbGaugeChart
46
+ options={chartOptions}
47
+ {...props}
48
+ />
49
+ <PbGaugeChart
50
+ options={chartOptions2}
51
+ {...props}
52
+ />
53
+ </div>
54
+ )
55
+
56
+ export default PbGaugeChartHeight