playbook_ui 15.7.0.pre.alpha.play263313229 → 15.7.0.pre.alpha.play270013253

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 (158) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -4
  3. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.html.erb +2 -2
  4. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.jsx +3 -2
  5. data/dist/chunks/_typeahead-CZqKJ2_B.js +6 -0
  6. data/dist/chunks/lib-DOcjHvyR.js +29 -0
  7. data/dist/chunks/vendor.js +2 -2
  8. data/dist/menu.yml +0 -29
  9. data/dist/playbook-rails-react-bindings.js +1 -1
  10. data/dist/playbook-rails.js +1 -1
  11. data/dist/playbook.css +1 -1
  12. data/lib/playbook/version.rb +1 -1
  13. metadata +4 -147
  14. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.scss +0 -6
  15. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +0 -196
  16. data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +0 -31
  17. data/app/pb_kits/playbook/pb_bar_graph/barGraphSettings.js +0 -32
  18. data/app/pb_kits/playbook/pb_bar_graph/barGraphTheme.ts +0 -106
  19. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.html.erb +0 -1
  20. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -98
  21. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.html.erb +0 -26
  22. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.jsx +0 -55
  23. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.md +0 -2
  24. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +0 -42
  25. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.md +0 -2
  26. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.html.erb +0 -26
  27. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +0 -55
  28. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.html.erb +0 -26
  29. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +0 -69
  30. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.md +0 -3
  31. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.html.erb +0 -58
  32. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +0 -64
  33. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.html.erb +0 -14
  34. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +0 -40
  35. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.html.erb +0 -15
  36. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.jsx +0 -48
  37. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.html.erb +0 -62
  38. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.jsx +0 -136
  39. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.md +0 -17
  40. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.html.erb +0 -23
  41. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.jsx +0 -52
  42. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.html.erb +0 -26
  43. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.jsx +0 -86
  44. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.md +0 -3
  45. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.html.erb +0 -20
  46. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.jsx +0 -46
  47. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.md +0 -2
  48. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.html.erb +0 -22
  49. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.jsx +0 -55
  50. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.md +0 -1
  51. data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +0 -1
  52. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +0 -28
  53. data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +0 -11
  54. data/app/pb_kits/playbook/pb_circle_chart/ChartsTypes.ts +0 -2
  55. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.scss +0 -16
  56. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +0 -228
  57. data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +0 -45
  58. data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +0 -88
  59. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.html.erb +0 -10
  60. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +0 -99
  61. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +0 -26
  62. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +0 -88
  63. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +0 -20
  64. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +0 -44
  65. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_rails.md +0 -2
  66. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +0 -2
  67. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +0 -20
  68. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +0 -43
  69. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +0 -5
  70. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +0 -19
  71. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +0 -38
  72. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.html.erb +0 -136
  73. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +0 -152
  74. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +0 -86
  75. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +0 -142
  76. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +0 -14
  77. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +0 -63
  78. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +0 -22
  79. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +0 -45
  80. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.html.erb +0 -37
  81. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +0 -61
  82. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.html.erb +0 -22
  83. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +0 -41
  84. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.html.erb +0 -38
  85. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +0 -55
  86. data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +0 -1
  87. data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +0 -26
  88. data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +0 -11
  89. data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +0 -104
  90. data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +0 -16
  91. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +0 -174
  92. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +0 -173
  93. data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +0 -20
  94. data/app/pb_kits/playbook/pb_gauge/_gauge.scss +0 -49
  95. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +0 -215
  96. data/app/pb_kits/playbook/pb_gauge/docs/_description.md +0 -1
  97. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.html.erb +0 -12
  98. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.jsx +0 -36
  99. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_rails.md +0 -2
  100. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_react.md +0 -2
  101. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.html.erb +0 -32
  102. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +0 -146
  103. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_rails.md +0 -1
  104. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_react.md +0 -1
  105. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb +0 -11
  106. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +0 -30
  107. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.html.erb +0 -12
  108. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +0 -36
  109. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb +0 -14
  110. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +0 -49
  111. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb +0 -15
  112. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +0 -62
  113. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +0 -76
  114. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb +0 -15
  115. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +0 -54
  116. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.md +0 -1
  117. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb +0 -27
  118. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +0 -80
  119. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.md +0 -2
  120. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb +0 -14
  121. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +0 -38
  122. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb +0 -29
  123. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +0 -72
  124. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units_react.md +0 -1
  125. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +0 -27
  126. data/app/pb_kits/playbook/pb_gauge/docs/index.js +0 -11
  127. data/app/pb_kits/playbook/pb_gauge/gauge.html.erb +0 -2
  128. data/app/pb_kits/playbook/pb_gauge/gauge.rb +0 -56
  129. data/app/pb_kits/playbook/pb_gauge/gauge.test.js +0 -35
  130. data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +0 -91
  131. data/app/pb_kits/playbook/pb_line_graph/_line_graph.scss +0 -3
  132. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +0 -166
  133. data/app/pb_kits/playbook/pb_line_graph/docs/_description.md +0 -1
  134. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.html.erb +0 -26
  135. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.jsx +0 -56
  136. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_rails.md +0 -2
  137. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_react.md +0 -3
  138. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.html.erb +0 -26
  139. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +0 -52
  140. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.html.erb +0 -26
  141. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +0 -70
  142. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.md +0 -3
  143. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.html.erb +0 -15
  144. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.jsx +0 -43
  145. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.html.erb +0 -16
  146. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.jsx +0 -49
  147. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.html.erb +0 -62
  148. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.jsx +0 -129
  149. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.md +0 -14
  150. data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -18
  151. data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -6
  152. data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +0 -52
  153. data/app/pb_kits/playbook/pb_line_graph/lineGraphSettings.js +0 -30
  154. data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +0 -125
  155. data/app/pb_kits/playbook/pb_line_graph/line_graph.html.erb +0 -1
  156. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +0 -93
  157. data/dist/chunks/_typeahead-Ckz1ce-2.js +0 -6
  158. data/dist/chunks/lib-DxDBrGZX.js +0 -29
@@ -1,173 +0,0 @@
1
- import colors from '../tokens/exports/_colors.module.scss'
2
- import typography from '../tokens/exports/_typography.module.scss'
3
-
4
- import { ThemeProps } from './themeTypes'
5
-
6
- const highchartsTheme: ThemeProps = {
7
- lang: {
8
- thousandsSep: ',',
9
- },
10
- colors: [
11
- colors.data_1,
12
- colors.data_2,
13
- colors.data_3,
14
- colors.data_4,
15
- colors.data_5,
16
- colors.data_6,
17
- colors.data_7,
18
- ],
19
- chart: {
20
- borderWidth: 0,
21
- borderRadius: 0,
22
- plotBackgroundColor: undefined,
23
- plotShadow: false,
24
- plotBorderWidth: 0,
25
- },
26
- title: {
27
- style: {
28
- color: colors.text_lt_default,
29
- fontFamily: typography.font_family_base,
30
- fontWeight: typography.bold,
31
- fontSize: typography.heading_3,
32
- },
33
- },
34
- subtitle: {
35
- style: {
36
- fontFamily: typography.font_family_base,
37
- color: colors.text_lt_light,
38
- fontWeight: typography.regular,
39
- fontSize: typography.text_base,
40
- },
41
- },
42
- xAxis: {
43
- gridLineWidth: 0,
44
- lineColor: colors.border_light,
45
- tickColor: colors.border_light,
46
- labels: {
47
- style: {
48
- fontFamily: typography.font_family_base,
49
- color: colors.text_lt_lighter,
50
- fontWeight: typography.bold,
51
- fontSize: typography.text_smaller,
52
- },
53
- },
54
- title: {
55
- style: {
56
- color: colors.text_lt_default,
57
- fontFamily: typography.font_family_base,
58
- fontWeight: typography.regular,
59
- fontSize: typography.heading_4,
60
- },
61
- },
62
- },
63
- yAxis: {
64
- alternateGridColor: undefined,
65
- minorTickInterval: null,
66
- gridLineColor: colors.border_light,
67
- minorGridLineColor: colors.border_light,
68
- lineWidth: 0,
69
- tickWidth: 0,
70
- labels: {
71
- style: {
72
- fontFamily: typography.font_family_base,
73
- color: colors.text_lt_lighter,
74
- fontWeight: typography.bold,
75
- fontSize: typography.text_smaller,
76
- },
77
- },
78
- title: {
79
- style: {
80
- fontFamily: typography.font_family_base,
81
- color: colors.text_lt_lighter,
82
- fontWeight: typography.bold,
83
- fontSize: typography.text_smaller,
84
- },
85
- },
86
- },
87
- legend: {
88
- layout: 'horizontal',
89
- align: 'center',
90
- verticalAlign: 'bottom',
91
- itemStyle: {
92
- fontFamily: typography.font_family_base,
93
- color: colors.text_lt_light,
94
- fontWeight: typography.regular,
95
- fontSize: typography.text_smaller,
96
- },
97
- itemHoverStyle: {
98
- color: colors.text_lt_default,
99
- },
100
- itemHiddenStyle: {
101
- color: colors.text_lt_lighter,
102
- },
103
- },
104
- tooltip: {
105
- backgroundColor: {
106
- linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
107
- stops: [
108
- [0, colors.bg_dark],
109
- [1, colors.bg_dark],
110
- ],
111
- },
112
- shadow: false,
113
- borderWidth: 0,
114
- borderRadius: 10,
115
- style: {
116
- fontFamily: typography.font_family_base,
117
- color: colors.text_dk_default,
118
- fontWeight: typography.regular,
119
- fontSize: typography.text_smaller,
120
- },
121
- },
122
- // specific to gauge
123
- // unfilled gauge color
124
- pane: {
125
- background: {
126
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
127
- // @ts-ignore
128
- borderColor: colors.border_light,
129
- },
130
- },
131
-
132
- plotOptions: {
133
- series: {
134
- threshold: null,
135
- },
136
- // PIE STYLES
137
- pie: {
138
- colors: [
139
- colors.data_1,
140
- colors.data_2,
141
- colors.data_3,
142
- colors.data_4,
143
- colors.data_5,
144
- colors.data_6,
145
- colors.data_7,
146
- ],
147
- dataLabels: {
148
- style: {
149
- fontFamily: typography.font_family_base,
150
- fontSize: typography.text_smaller,
151
- color: colors.text_lt_light,
152
- fontWeight: typography.regular,
153
- textOutline: '2px $white',
154
- },
155
- },
156
- },
157
-
158
- // LINE CHART STYLES
159
- line: {
160
- dataLabels: {
161
- color: '#CCC',
162
- },
163
- marker: {
164
- lineColor: '#333',
165
- },
166
- }
167
- },
168
- credits: {
169
- enabled: false
170
- },
171
- }
172
-
173
- export { highchartsTheme }
@@ -1,20 +0,0 @@
1
- import { Options, LegendOptions } from "highcharts";
2
- export interface ThemeProps
3
- extends Pick<
4
- Options,
5
- | "credits"
6
- | "chart"
7
- | "colors"
8
- | "lang"
9
- | "title"
10
- | "subtitle"
11
- | "xAxis"
12
- | "yAxis"
13
- | "legend"
14
- | "tooltip"
15
- | "pane"
16
- | "plotOptions"
17
- > {
18
- colorKey?: string;
19
- legend?: LegendOptions;
20
- }
@@ -1,49 +0,0 @@
1
- @import "../tokens/colors";
2
-
3
- .pb_gauge_kit {
4
-
5
- .fix {
6
- fill: $text_lt_default;
7
- stroke: none;
8
-
9
- &.dark {
10
- fill: $text_dk_default;
11
- }
12
- }
13
-
14
- .suffix {
15
- fill: $text_lt_light;
16
- stroke: none;
17
- font: $regular $font_larger $font_family_base;
18
-
19
- &.dark {
20
- fill: $text_dk_light;
21
- }
22
- }
23
- .prefix {
24
- fill: $text_lt_light;
25
- stroke: none;
26
- font: $regular $font_base $font_family_base;
27
-
28
- &.dark {
29
- fill: $text_dk_light;
30
- }
31
- }
32
-
33
- rect.highcharts-background {
34
- fill: #0000 !important;
35
- }
36
-
37
- .gauge-pane {
38
- stroke-linejoin: round;
39
- }
40
-
41
- &.dark {
42
- color: $text_dk_default;
43
-
44
- .pb_title_kit_size_1,
45
- .pb_caption_kit_xs {
46
- color: $text_dk_light;
47
- }
48
- }
49
- }
@@ -1,215 +0,0 @@
1
- import React, { useState, useEffect } from "react";
2
- import classnames from "classnames";
3
- import HighchartsReact from "highcharts-react-official";
4
- import Highcharts from "highcharts";
5
- import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
6
- import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
7
- import mapColors from "../pb_dashboard/pbChartsColorsHelper";
8
- import highchartsMore from "highcharts/highcharts-more";
9
- import solidGauge from "highcharts/modules/solid-gauge";
10
- import defaultColors from "../tokens/exports/_colors.module.scss";
11
- import typography from "../tokens/exports/_typography.module.scss";
12
-
13
- import { deprecatedKitWarning } from "../utilities/deprecated";
14
- import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
15
- import { globalProps } from "../utilities/globalProps";
16
- import { GenericObject } from "../types";
17
- import { merge } from '../utilities/object'
18
-
19
- type GaugeProps = {
20
- aria: { [key: string]: string };
21
- className?: string;
22
- chartData?: { name: string; value: number[] | number }[];
23
- customOptions?: Partial<Highcharts.Options>;
24
- dark?: boolean;
25
- data?: { [key: string]: string };
26
- disableAnimation?: boolean;
27
- fullCircle?: boolean;
28
- height?: string;
29
- htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
30
- id?: string;
31
- max?: number;
32
- min?: number;
33
- prefix?: string;
34
- showLabels?: boolean;
35
- style?: string;
36
- suffix?: string;
37
- title?: string;
38
- tooltipHtml?: string;
39
- colors: string[];
40
- minorTickInterval?: number;
41
- circumference: number[];
42
- };
43
-
44
- const Gauge = ({
45
- aria = {},
46
- chartData,
47
- customOptions = {},
48
- dark = false,
49
- data = {},
50
- disableAnimation = false,
51
- fullCircle = false,
52
- height = null,
53
- htmlOptions = {},
54
- id,
55
- max = 100,
56
- min = 0,
57
- prefix = "",
58
- showLabels = false,
59
- style = "solidgauge",
60
- suffix = "",
61
- title = "",
62
- tooltipHtml = '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' +
63
- "<b>{point.y}</b>",
64
- colors = [],
65
- minorTickInterval = null,
66
- circumference = fullCircle ? [0, 360] : [-100, 100],
67
- ...props
68
- }: GaugeProps): React.ReactElement => {
69
- const ariaProps = buildAriaProps(aria);
70
- const dataProps = buildDataProps(data)
71
- const htmlProps = buildHtmlProps(htmlOptions);
72
- highchartsMore(Highcharts);
73
- solidGauge(Highcharts);
74
- const setupTheme = () => {
75
- dark
76
- ? Highcharts.setOptions(highchartsDarkTheme)
77
- : Highcharts.setOptions(highchartsTheme);
78
- };
79
- setupTheme();
80
-
81
- //set tooltip directly to prevent being overriden by Highcharts defaults
82
- Highcharts.setOptions({
83
- tooltip: {
84
- pointFormat: tooltipHtml,
85
- followPointer: true,
86
- },
87
- });
88
-
89
- const css = buildCss({
90
- pb_gauge_kit: true,
91
- });
92
-
93
- const [options, setOptions] = useState({});
94
-
95
- useEffect(() => {
96
- const formattedChartData = chartData.map((obj: GenericObject) => {
97
- obj.y = obj.value;
98
- delete obj.value;
99
- return obj;
100
- });
101
-
102
- const staticOptions = {
103
- chart: {
104
- events: {
105
- load() {
106
- setTimeout(this.reflow.bind(this), 0);
107
- },
108
- },
109
- type: style,
110
- height: height,
111
- },
112
- title: {
113
- text: title,
114
- },
115
- yAxis: {
116
- min: min,
117
- max: max,
118
- lineWidth: 0,
119
- tickWidth: 0,
120
- minorTickInterval: minorTickInterval,
121
- tickAmount: 2,
122
- tickPositions: [min, max],
123
- labels: {
124
- y: 26,
125
- enabled: showLabels,
126
- },
127
- },
128
- credits: false,
129
- series: [
130
- {
131
- data: formattedChartData,
132
- },
133
- ],
134
- pane: {
135
- center: ["50%", "50%"],
136
- size: "90%",
137
- startAngle: circumference[0],
138
- endAngle: circumference[1],
139
- background: {
140
- borderWidth: 20,
141
- innerRadius: "90%",
142
- outerRadius: "90%",
143
- shape: "arc",
144
- className: "gauge-pane",
145
- },
146
- },
147
- colors:
148
- colors !== undefined && colors.length > 0
149
- ? mapColors(colors)
150
- : highchartsTheme.colors,
151
- plotOptions: {
152
- series: {
153
- animation: !disableAnimation,
154
- },
155
- solidgauge: {
156
- borderColor:
157
- colors !== undefined && colors.length === 1
158
- ? mapColors(colors).join()
159
- : highchartsTheme.colors[0],
160
- borderWidth: 20,
161
- radius: 90,
162
- innerRadius: "90%",
163
- dataLabels: {
164
- borderWidth: 0,
165
- color: defaultColors.text_lt_default,
166
- enabled: true,
167
- format:
168
- `<span class="prefix${dark ? " dark" : ""}">${prefix}</span>` +
169
- `<span class="fix${dark ? " dark" : ""}">{y:,f}</span>` +
170
- `<span class="suffix${dark ? " dark" : ""}">${suffix}</span>`,
171
- style: {
172
- fontFamily: typography.font_family_base,
173
- fontWeight: typography.regular,
174
- fontSize: typography.heading_2,
175
- },
176
- y: -26,
177
- },
178
- },
179
- },
180
- };
181
-
182
- setOptions(merge(staticOptions, customOptions));
183
-
184
- if (document.querySelector(".prefix")) {
185
- document.querySelectorAll(".prefix").forEach((prefix) => {
186
- prefix.setAttribute("y", "28");
187
- });
188
- document
189
- .querySelectorAll(".fix")
190
- .forEach((fix) => fix.setAttribute("y", "38"));
191
- }
192
- // eslint-disable-next-line react-hooks/exhaustive-deps
193
- }, [chartData]);
194
-
195
- useEffect(() => {
196
- // Warn about deprecated kit
197
- deprecatedKitWarning('Gauge', 'Please use "PbGaugeChart" instead.');
198
- }, []);
199
-
200
- return (
201
- <HighchartsReact
202
- containerProps={{
203
- className: classnames(css, globalProps(props)),
204
- id: id,
205
- ...ariaProps,
206
- ...dataProps,
207
- ...htmlProps,
208
- }}
209
- highcharts={Highcharts}
210
- options={options}
211
- />
212
- );
213
- };
214
-
215
- export default Gauge;
@@ -1 +0,0 @@
1
- **Important Note for the React Kit**: In order to leverage this kit, you must install `highcharts` and `highcharts-react-official` into your project as shown below. To then apply Playbook styles to your Highchart, import gaugeTheme.ts from playbook-ui and merge it with your Highchart options. Then, pass the merged value to the options prop. Playbook’s styling will be applied automatically. See the examples in the documentation below.
@@ -1,12 +0,0 @@
1
- <% data = [
2
- {
3
- name: 'Name',
4
- value: 67,
5
- }
6
- ]%>
7
-
8
- <%= pb_rails("gauge", props: {
9
- id: "gauge-colors",
10
- chart_data: data,
11
- colors: ['data-7']
12
- }) %>
@@ -1,36 +0,0 @@
1
- import React from 'react'
2
- import gaugeTheme from '../gaugeTheme'
3
- import Highcharts from "highcharts"
4
- import HighchartsReact from "highcharts-react-official"
5
- import HighchartsMore from "highcharts/highcharts-more"
6
- import SolidGauge from "highcharts/modules/solid-gauge"
7
- import colors from '../../tokens/exports/_colors.module.scss'
8
-
9
- HighchartsMore(Highcharts);
10
- SolidGauge(Highcharts);
11
-
12
- const data = [{ name: "Name", y: 67 }]
13
-
14
- const baseOptions = {
15
- series: [{ data: data }],
16
- plotOptions: {
17
- solidgauge: {
18
- borderColor: colors.data_7,
19
- }
20
- },
21
- };
22
-
23
- const GaugeColors = () => {
24
- const options = Highcharts.merge({}, gaugeTheme, baseOptions);
25
-
26
- return (
27
- <div>
28
- <HighchartsReact
29
- highcharts={Highcharts}
30
- options={options}
31
- />
32
- </div>
33
- );
34
- };
35
-
36
- export default GaugeColors;
@@ -1,2 +0,0 @@
1
- Custom data colors allow for color customization to match the needs of business requirements.
2
- Pass the prop `colors` and use **ONE** desired value `data-1 | data-2 | data-3 | data-4 | data-5 | data-6 | data-7 | data-8` in an array. Hex colors are also available `eg: #CA0095`
@@ -1,2 +0,0 @@
1
- Custom data colors allow for color customization to match the needs of business requirements.
2
- 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`
@@ -1,32 +0,0 @@
1
- <%= pb_rails("flex", props: {wrap: true, padding: "xl", gap: "sm"}) do %>
2
- <%= pb_rails("flex/flex_item", props: {flex: 1, grow: true }) do %>
3
- <%= pb_rails("card", props: {max_width: "xs", padding: "md", }) do %>
4
- <%= pb_rails("title", props: {padding_bottom: "sm", size: 4, text: "Abandoned Calls" })%>
5
- <%= pb_rails("flex", props: {align: "stretch"}) do %>
6
- <%= pb_rails("flex", props: {margin_right: "sm", orientation: "column"}) do %>
7
- <%= pb_rails("body", props: {color: "light", padding_bottom: "sm",text: "Total Abandoned"}) %>
8
- <%= pb_rails("flex", props: {align: "baseline", padding_bottom: "sx"}) do %>
9
- <%= pb_rails("title", props: {size: 1, text: "39"})%>
10
- <%= pb_rails("title", props: {color: "light", size: 3, text: "calls"}) %>
11
- <% end %>
12
- <%= pb_rails("caption", props: {size: "xs", text: "of 390" }) %>
13
- <%end %>
14
- <%= pb_rails("section_separator", props: {align_self: "stretch", margin_right: "sm", orientation: "vertical" }) %>
15
- <%= pb_rails("flex", props: {orientation: "column", wrap: true}) do %>
16
- <%= pb_rails("body", props: {color: "light", text: "% Abandoned"}) %>
17
- <%= pb_rails("flex", props: {wrap: true}) do %>
18
- <%= pb_rails("flex/flex_item", props: {fixed_size: "150px", overflow: "hidden", shrink: true}) do %>
19
- <%= pb_rails("gauge", props: {
20
- chart_data: [{ name: "Name", value: 10 }],
21
- disable_animation: true,
22
- height: '150',
23
- id: "gauge-complex",
24
- suffix: "%"
25
- }) %>
26
- <% end %>
27
- <% end %>
28
- <% end %>
29
- <%end %>
30
- <% end %>
31
- <% end %>
32
- <% end %>
@@ -1,146 +0,0 @@
1
- import React from "react";
2
-
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 gaugeTheme from '../gaugeTheme'
11
- import Highcharts from "highcharts"
12
- import HighchartsReact from "highcharts-react-official"
13
- import HighchartsMore from "highcharts/highcharts-more"
14
- import SolidGauge from "highcharts/modules/solid-gauge"
15
- import colors from '../../tokens/exports/_colors.module.scss'
16
- import typography from '../../tokens/exports/_typography.module.scss'
17
-
18
- HighchartsMore(Highcharts);
19
- SolidGauge(Highcharts);
20
-
21
- const data = [{ name: "Name", y: 10 }];
22
-
23
- const baseOptions = {
24
- series: [{ data: data }],
25
- chart: {
26
- height: "150",
27
- },
28
- plotOptions: {
29
- series: {
30
- animation: false,
31
- },
32
- solidgauge: {
33
- dataLabels: {
34
- format:
35
- `<span class="fix">{y:,f}</span>` +
36
- `<span style="fill: ${colors.text_lt_light}; font-size: ${typography.text_larger};">%</span>`,
37
- },
38
- },
39
- },
40
- };
41
-
42
- const options = Highcharts.merge({}, gaugeTheme, baseOptions);
43
-
44
- const GaugeComplex = (props) => (
45
- <Flex
46
- gap="sm"
47
- padding="xl"
48
- wrap
49
- {...props}
50
- >
51
- <FlexItem
52
- flex={1}
53
- grow
54
- {...props}
55
- >
56
- <Card
57
- maxWidth="xs"
58
- padding="md"
59
- {...props}
60
- >
61
- <Title
62
- paddingBottom="sm"
63
- size={4}
64
- text="Abandoned Calls"
65
- {...props}
66
- />
67
- <Flex
68
- align="stretch"
69
- {...props}
70
- >
71
- <Flex
72
- marginRight="sm"
73
- orientation="column"
74
- {...props}
75
- >
76
- <Body
77
- color="light"
78
- paddingBottom="sm"
79
- text="Total Abandoned"
80
- {...props}
81
- />
82
- <Flex
83
- align="baseline"
84
- paddingBottom="xs"
85
- {...props}
86
- >
87
- <Title
88
- size={1}
89
- text="39"
90
- {...props}
91
- />
92
- <Title
93
- color="light"
94
- size={3}
95
- text="calls"
96
- {...props}
97
- />
98
- </Flex>
99
- <Caption
100
- size="xs"
101
- text="of 390"
102
- {...props}
103
- />
104
- </Flex>
105
-
106
- <SectionSeparator
107
- alignSelf="stretch"
108
- marginRight="sm"
109
- orientation="vertical"
110
- {...props}
111
- />
112
-
113
- <Flex
114
- orientation="column"
115
- wrap
116
- {...props}
117
- >
118
- <Body
119
- color="light"
120
- text="% Abandoned"
121
- {...props}
122
- />
123
- <Flex
124
- wrap
125
- {...props}
126
- >
127
- <FlexItem
128
- fixedSize="150px"
129
- overflow="hidden"
130
- shrink
131
- {...props}
132
- >
133
- <HighchartsReact
134
- highcharts={Highcharts}
135
- options={options}
136
- />
137
- </FlexItem>
138
- </Flex>
139
- </Flex>
140
- </Flex>
141
- </Card>
142
- </FlexItem>
143
- </Flex>
144
- );
145
-
146
- export default GaugeComplex;
@@ -1 +0,0 @@
1
- We are able to wrap our Gauge kits within multiple other Flex and Card components.
@@ -1 +0,0 @@
1
- We are able to wrap the Highcharts Gauge kit within Playbook kits (such as Flex and Card components).