playbook_ui 11.12.1.pre.alpha.charts1 → 11.12.1.pre.alpha.passphrase1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/index.js +1 -0
  3. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +111 -0
  4. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +151 -0
  5. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.html.erb +21 -9
  6. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +47 -7
  7. data/app/pb_kits/playbook/pb_dashboard/{pbChartsDarkTheme.ts → pbChartsDarkTheme.js} +21 -6
  8. data/app/pb_kits/playbook/pb_dashboard/{pbChartsLightTheme.ts → pbChartsLightTheme.js} +21 -6
  9. data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +112 -0
  10. data/app/pb_kits/playbook/pb_gauge/_gauge.scss +0 -4
  11. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.html.erb +1 -1
  12. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +8 -8
  13. data/app/pb_kits/playbook/pb_gauge/gauge.html.erb +11 -1
  14. data/app/pb_kits/playbook/pb_gauge/gauge.rb +8 -3
  15. data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +113 -0
  16. data/app/pb_kits/playbook/pb_passphrase/_passphrase.jsx +56 -97
  17. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.html.erb +145 -1
  18. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.jsx +127 -3
  19. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.md +11 -2
  20. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.html.erb +136 -0
  21. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.jsx +90 -8
  22. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.md +5 -0
  23. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.html.erb +51 -0
  24. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx +39 -0
  25. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_default.html.erb +0 -2
  26. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_default.jsx +6 -20
  27. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_input_props.html.erb +2 -2
  28. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_input_props.jsx +1 -1
  29. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.html.erb +318 -5
  30. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx +134 -48
  31. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.md +11 -5
  32. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.html.erb +123 -0
  33. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.jsx +96 -20
  34. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.md +6 -2
  35. data/app/pb_kits/playbook/pb_passphrase/docs/example.yml +4 -0
  36. data/app/pb_kits/playbook/pb_passphrase/docs/index.js +1 -0
  37. data/app/pb_kits/playbook/pb_passphrase/passphrase.html.erb +1 -1
  38. data/app/pb_kits/playbook/pb_passphrase/passphrase.rb +5 -9
  39. data/app/pb_kits/playbook/pb_passphrase/passphrase.test.jsx +0 -47
  40. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx +79 -0
  41. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +1 -1
  42. data/app/pb_kits/playbook/playbook-rails-react-bindings.js +0 -4
  43. data/app/pb_kits/playbook/playbook-rails.js +4 -0
  44. data/app/pb_kits/playbook/plugins/pb_chart.js +322 -0
  45. data/lib/playbook/version.rb +1 -1
  46. metadata +15 -16
  47. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +0 -145
  48. data/app/pb_kits/playbook/pb_circle_chart/ChartsTypes.ts +0 -2
  49. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +0 -216
  50. data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +0 -16
  51. data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +0 -16
  52. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +0 -213
  53. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +0 -148
  54. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_default.md +0 -1
  55. data/app/pb_kits/playbook/pb_passphrase/passwordStrength.js +0 -55
  56. data/app/pb_kits/playbook/pb_passphrase/useHaveIBeenPwned.js +0 -52
  57. data/app/pb_kits/playbook/pb_passphrase/useZxcvbn.js +0 -58
  58. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +0 -111
@@ -0,0 +1,322 @@
1
+ import Highcharts from 'highcharts'
2
+
3
+ import { highchartsTheme } from '../pb_dashboard/pbChartsLightTheme'
4
+ import { highchartsDarkTheme } from '../pb_dashboard/pbChartsDarkTheme'
5
+ import colors from '../tokens/exports/_colors.scss'
6
+
7
+ import pie from 'highcharts/modules/variable-pie'
8
+ import highchartsMore from 'highcharts/highcharts-more'
9
+ import solidGauge from 'highcharts/modules/solid-gauge'
10
+ import treemap from 'highcharts/modules/treemap'
11
+
12
+ pie(Highcharts)
13
+
14
+ // Map Data Color String Props to our SCSS Variables
15
+
16
+ const mapColors = (array) => {
17
+ const regex = /(data)\-[1-8]/ //eslint-disable-line
18
+
19
+ const newArray = array.map((item) => {
20
+ return regex.test(item)
21
+ ? `${colors[`data_${item[item.length - 1]}`]}`
22
+ : item
23
+ })
24
+ return newArray
25
+ }
26
+
27
+ // Adjust Circle Chart Block Kit Dimensions to Match the Chart for Centering
28
+ const alignBlockElement = (event) => {
29
+ const itemToMove = document.querySelector(`#wrapper-circle-chart-${event.target.renderTo.id} .pb-circle-chart-block`)
30
+ const chartContainer = document.querySelector(`#${event.target.renderTo.id}`)
31
+ if (itemToMove !== null) {
32
+ itemToMove.style.height = `${event.target.chartHeight}px`
33
+ itemToMove.style.width = `${event.target.chartWidth}px`;
34
+ (chartContainer.firstChild).before(itemToMove)
35
+ }
36
+ }
37
+
38
+ class pbChart {
39
+ defaults = {
40
+ callbackInitializeBefore: () => {},
41
+ callbackInitializeAfter: () => {},
42
+ callbackRefreshBefore: () => {},
43
+ callbackRefreshAfter: () => {},
44
+ callbackDestroyBefore: () => {},
45
+ callbackDestroyAfter: () => {},
46
+ property: 'Value',
47
+ }
48
+
49
+ extendDefaults(defaults, options) {
50
+ for (const property in options) {
51
+ if (Object.prototype.hasOwnProperty.call(options, property)) {
52
+ defaults[property] = options[property]
53
+ }
54
+ }
55
+ return defaults
56
+ }
57
+
58
+ constructor(element, options) {
59
+ this.element = element
60
+ this.options = options
61
+ this.settings = this.extendDefaults(this.defaults, options)
62
+
63
+ if (this.options.type == 'variablepie' || this.options.type == 'pie'){
64
+ this.setupPieChart(options)
65
+ } else if (this.options.type == 'gauge') {
66
+ this.setupGauge(options)
67
+ } else if (this.options.type == 'treemap') {
68
+ this.setupTreemap(options)
69
+ } else {
70
+ this.setupChart(options)
71
+ }
72
+ }
73
+
74
+ setupTheme() {
75
+ this.options.dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme)
76
+ }
77
+
78
+ setupGauge(options) {
79
+ highchartsMore(Highcharts)
80
+ solidGauge(Highcharts)
81
+ this.setupTheme()
82
+
83
+ Highcharts.chart(this.defaults.id, {
84
+ chart: {
85
+ events: {
86
+ load() {
87
+ setTimeout(this.reflow.bind(this), 0)
88
+ },
89
+ },
90
+ type: this.defaults.style,
91
+ height: this.defaults.height,
92
+ },
93
+ title: {
94
+ text: this.defaults.title,
95
+ },
96
+ yAxis: {
97
+ min: this.defaults.min,
98
+ max: this.defaults.max,
99
+ lineWidth: 0,
100
+ tickWidth: 0,
101
+ minorTickInterval: null,
102
+ tickAmount: 2,
103
+ tickPositions: [this.defaults.min, this.defaults.max],
104
+ labels: {
105
+ y: 26,
106
+ enabled: this.defaults.showLabels,
107
+ },
108
+ },
109
+ credits: false,
110
+ series: [
111
+ {
112
+ data: this.defaults.chartData,
113
+ },
114
+ ],
115
+ pane: {
116
+ center: ['50%', '50%'],
117
+ size: '90%',
118
+ startAngle: this.defaults.circumference[0],
119
+ endAngle: this.defaults.circumference[1],
120
+ background: {
121
+ borderWidth: 20,
122
+ innerRadius: '90%',
123
+ outerRadius: '90%',
124
+ shape: 'arc',
125
+ className: 'gauge-pane',
126
+ },
127
+ },
128
+ tooltip: {
129
+ headerFormat: '',
130
+ pointFormat: this.defaults.tooltipHtml,
131
+ followPointer: true,
132
+ },
133
+ colors: options.colors !== undefined && options.colors.length > 0 ? mapColors(options.colors) : highchartsTheme.colors,
134
+ plotOptions: {
135
+ series: {
136
+ animation: !this.defaults.disableAnimation,
137
+ },
138
+ solidgauge: {
139
+ borderColor: options.colors !== undefined && options.colors.length === 1 ? mapColors(options.colors).join() : highchartsTheme.colors[0],
140
+ dataLabels: {
141
+ format: `<span class="prefix">${this.defaults.prefix}</span>` +
142
+ '<span class="fix">{y:,f}</span>' +
143
+ `<span class="suffix">${this.defaults.suffix}</span>`,
144
+ } },
145
+ },
146
+ },
147
+ )
148
+ document.querySelectorAll('.gauge-pane').forEach((pane) => pane.setAttribute('stroke-linejoin', 'round'))
149
+ if (document.querySelector('.prefix')) {
150
+ document.querySelectorAll('.prefix').forEach((prefix) => prefix.setAttribute('y', '28'))
151
+ document.querySelectorAll('.fix').forEach((fix) => fix.setAttribute('y', '38'))
152
+ }
153
+ }
154
+
155
+ setupPieChart(options) {
156
+ this.setupTheme()
157
+ Highcharts.chart(this.defaults.id, {
158
+ title: {
159
+ text: this.defaults.title,
160
+ },
161
+ chart: {
162
+ height: this.defaults.height,
163
+ type: this.defaults.type,
164
+ events: {
165
+ render: (event) => alignBlockElement(event),
166
+ redraw: (event) => alignBlockElement(event),
167
+ },
168
+ },
169
+
170
+ legend: {
171
+ align: this.defaults.align,
172
+ verticalAlign: this.defaults.verticalAlign,
173
+ layout: this.defaults.layout,
174
+ x: this.defaults.x,
175
+ y: this.defaults.y,
176
+ },
177
+
178
+ plotOptions: {
179
+ pie: {
180
+ colors: options.colors.length > 0 ? mapColors(options.colors) : highchartsTheme.colors,
181
+ dataLabels: {
182
+ enabled: this.defaults.dataLabels,
183
+ connectorShape: 'straight',
184
+ connectorWidth: 3,
185
+ format: this.defaults.dataLabelHtml,
186
+ },
187
+ showInLegend: this.defaults.showInLegend,
188
+ },
189
+ },
190
+
191
+ tooltip: {
192
+ headerFormat: this.defaults.headerFormat,
193
+ pointFormat: this.defaults.tooltipHtml,
194
+ useHTML: this.defaults.useHTML,
195
+ },
196
+ series: [{
197
+ minPointSize: this.defaults.minPointSize,
198
+ maxPointSize: this.defaults.maxPointSize,
199
+ innerSize: options.borderWidth == 20 ? '100%' : this.defaults.innerSize,
200
+ data: this.defaults.chartData,
201
+ zMin: this.defaults.zMin,
202
+ startAngle: this.defaults.startAngle,
203
+ borderWidth: this.defaults.borderWidth,
204
+ borderColor: options.borderWidth == 20 ? null : this.defaults.innerSize,
205
+ }],
206
+ credits: false,
207
+ })
208
+ }
209
+
210
+ setupTreemap(options) {
211
+ treemap(Highcharts)
212
+ this.setupTheme()
213
+ options.dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme)
214
+
215
+ Highcharts.chart(this.defaults.id, {
216
+ title: {
217
+ text: this.defaults.title,
218
+ },
219
+ chart: {
220
+ height: this.defaults.height,
221
+ type: this.defaults.type,
222
+ },
223
+ credits: false,
224
+ series: [{
225
+ data: this.defaults.chartData,
226
+ }],
227
+ plotOptions: {
228
+ treemap: {
229
+ allowTraversingTree: this.defaults.drillable,
230
+ colorByPoint: !this.defaults.grouped,
231
+ colors: options.colors !== undefined && options.colors.length > 0 ? mapColors(options.colors) : highchartsTheme.colors,
232
+ },
233
+ },
234
+ tooltip: {
235
+ pointFormat: this.defaults.tooltipHtml,
236
+ useHTML: true,
237
+ },
238
+ })
239
+ }
240
+
241
+ setupChart(options) {
242
+ this.setupTheme()
243
+ const configOptions = {
244
+ title: {
245
+ text: this.defaults.title,
246
+ },
247
+ chart: {
248
+ height: this.defaults.height,
249
+ type: this.defaults.type,
250
+ },
251
+ subtitle: {
252
+ text: this.defaults.subtitle,
253
+ },
254
+ yAxis: {
255
+ min: this.defaults.yAxisMin,
256
+ max: this.defaults.yAxisMax,
257
+ title: {
258
+ text: this.defaults.axisTitle,
259
+ },
260
+ },
261
+ xAxis: {
262
+ categories: this.defaults.xAxisCategories,
263
+ },
264
+ legend: {
265
+ enabled: this.defaults.legend,
266
+ align: this.defaults.align,
267
+ verticalAlign: this.defaults.verticalAlign,
268
+ layout: this.defaults.layout,
269
+ x: this.defaults.x,
270
+ y: this.defaults.y,
271
+ },
272
+ colors: options.colors !== undefined && options.colors.length > 0 ? mapColors(options.colors) : highchartsTheme.colors,
273
+ plotOptions: {
274
+ series: {
275
+ pointStart: this.defaults.pointStart,
276
+ dataLabels: {
277
+ enabled: false,
278
+ },
279
+ },
280
+ },
281
+ series: this.defaults.chartData,
282
+ credits: false,
283
+ }
284
+
285
+ if (!this.defaults.toggleLegendClick) {
286
+ configOptions.plotOptions.series.events = { legendItemClick: () => false }
287
+ }
288
+
289
+ Highcharts.chart(this.defaults.id, configOptions)
290
+ }
291
+
292
+ refresh(silent = false) {
293
+ if (!silent) {
294
+ this.settings.callbackRefreshBefore.call()
295
+ }
296
+
297
+ this.this.destroy(silent)
298
+ this.this.initialize(silent)
299
+ if (!silent) {
300
+ this.settings.callbackRefreshAfter.call()
301
+ }
302
+ }
303
+
304
+ destroy(silent = false) {
305
+ if (!silent) {
306
+ this.settings.callbackDestroyBefore.call()
307
+ }
308
+ if (!silent) {
309
+ this.settings.callbackDestroyAfter.call()
310
+ }
311
+ }
312
+
313
+ refreshSilently() {
314
+ this.this.refresh(true)
315
+ }
316
+
317
+ destroySilently() {
318
+ this.this.destroy(true)
319
+ }
320
+ }
321
+
322
+ export default pbChart
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "11.12.1"
5
- VERSION = "11.12.1.pre.alpha.charts1"
5
+ VERSION = "11.12.1.pre.alpha.passphrase1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.12.1.pre.alpha.charts1
4
+ version: 11.12.1.pre.alpha.passphrase1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-11-30 00:00:00.000000000 Z
12
+ date: 2022-11-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -361,8 +361,8 @@ files:
361
361
  - app/pb_kits/playbook/pb_badge/docs/_description.md
362
362
  - app/pb_kits/playbook/pb_badge/docs/example.yml
363
363
  - app/pb_kits/playbook/pb_badge/docs/index.js
364
+ - app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
364
365
  - app/pb_kits/playbook/pb_bar_graph/_bar_graph.scss
365
- - app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx
366
366
  - app/pb_kits/playbook/pb_bar_graph/barGraphSettings.js
367
367
  - app/pb_kits/playbook/pb_bar_graph/bar_graph.html.erb
368
368
  - app/pb_kits/playbook/pb_bar_graph/bar_graph.rb
@@ -540,9 +540,8 @@ files:
540
540
  - app/pb_kits/playbook/pb_checkbox/docs/_description.md
541
541
  - app/pb_kits/playbook/pb_checkbox/docs/example.yml
542
542
  - app/pb_kits/playbook/pb_checkbox/docs/index.js
543
- - app/pb_kits/playbook/pb_circle_chart/ChartsTypes.ts
543
+ - app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx
544
544
  - app/pb_kits/playbook/pb_circle_chart/_circle_chart.scss
545
- - app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx
546
545
  - app/pb_kits/playbook/pb_circle_chart/circle_chart.html.erb
547
546
  - app/pb_kits/playbook/pb_circle_chart/circle_chart.rb
548
547
  - app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb
@@ -639,10 +638,8 @@ files:
639
638
  - app/pb_kits/playbook/pb_currency/docs/example.yml
640
639
  - app/pb_kits/playbook/pb_currency/docs/index.js
641
640
  - app/pb_kits/playbook/pb_dashboard/commonSettings.js
642
- - app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts
643
- - app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts
644
- - app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts
645
- - app/pb_kits/playbook/pb_dashboard/themeTypes.ts
641
+ - app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js
642
+ - app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js
646
643
  - app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx
647
644
  - app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.scss
648
645
  - app/pb_kits/playbook/pb_dashboard_value/_dashboard_value_mixins.scss
@@ -1029,8 +1026,8 @@ files:
1029
1026
  - app/pb_kits/playbook/pb_form_pill/docs/index.js
1030
1027
  - app/pb_kits/playbook/pb_form_pill/form_pill.html.erb
1031
1028
  - app/pb_kits/playbook/pb_form_pill/form_pill.rb
1029
+ - app/pb_kits/playbook/pb_gauge/_gauge.jsx
1032
1030
  - app/pb_kits/playbook/pb_gauge/_gauge.scss
1033
- - app/pb_kits/playbook/pb_gauge/_gauge.tsx
1034
1031
  - app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.html.erb
1035
1032
  - app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.jsx
1036
1033
  - app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.md
@@ -1307,8 +1304,8 @@ files:
1307
1304
  - app/pb_kits/playbook/pb_lightbox/hooks/useWindowSize.ts
1308
1305
  - app/pb_kits/playbook/pb_lightbox/lightbox.scss
1309
1306
  - app/pb_kits/playbook/pb_lightbox/lightbox.test.jsx
1307
+ - app/pb_kits/playbook/pb_line_graph/_line_graph.jsx
1310
1308
  - app/pb_kits/playbook/pb_line_graph/_line_graph.scss
1311
- - app/pb_kits/playbook/pb_line_graph/_line_graph.tsx
1312
1309
  - app/pb_kits/playbook/pb_line_graph/docs/_description.md
1313
1310
  - app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.html.erb
1314
1311
  - app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.jsx
@@ -1461,16 +1458,20 @@ files:
1461
1458
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.html.erb
1462
1459
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.jsx
1463
1460
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.md
1461
+ - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.html.erb
1464
1462
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.jsx
1463
+ - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.md
1464
+ - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.html.erb
1465
+ - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
1465
1466
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_default.html.erb
1466
1467
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_default.jsx
1467
- - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_default.md
1468
1468
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_input_props.html.erb
1469
1469
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_input_props.jsx
1470
1470
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_input_props.md
1471
1471
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.html.erb
1472
1472
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx
1473
1473
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.md
1474
+ - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.html.erb
1474
1475
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.jsx
1475
1476
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.md
1476
1477
  - app/pb_kits/playbook/pb_passphrase/docs/_passphrase_tips.html.erb
@@ -1481,9 +1482,6 @@ files:
1481
1482
  - app/pb_kits/playbook/pb_passphrase/passphrase.html.erb
1482
1483
  - app/pb_kits/playbook/pb_passphrase/passphrase.rb
1483
1484
  - app/pb_kits/playbook/pb_passphrase/passphrase.test.jsx
1484
- - app/pb_kits/playbook/pb_passphrase/passwordStrength.js
1485
- - app/pb_kits/playbook/pb_passphrase/useHaveIBeenPwned.js
1486
- - app/pb_kits/playbook/pb_passphrase/useZxcvbn.js
1487
1485
  - app/pb_kits/playbook/pb_person/_person.jsx
1488
1486
  - app/pb_kits/playbook/pb_person/_person.scss
1489
1487
  - app/pb_kits/playbook/pb_person/docs/_description.md
@@ -2092,7 +2090,7 @@ files:
2092
2090
  - app/pb_kits/playbook/pb_tooltip/tooltip.html.erb
2093
2091
  - app/pb_kits/playbook/pb_tooltip/tooltip.rb
2094
2092
  - app/pb_kits/playbook/pb_tooltip/tooltip.test.jsx
2095
- - app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx
2093
+ - app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
2096
2094
  - app/pb_kits/playbook/pb_treemap_chart/docs/_description.md
2097
2095
  - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb
2098
2096
  - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx
@@ -2218,6 +2216,7 @@ files:
2218
2216
  - app/pb_kits/playbook/playbook-doc.js
2219
2217
  - app/pb_kits/playbook/playbook-rails-react-bindings.js
2220
2218
  - app/pb_kits/playbook/playbook-rails.js
2219
+ - app/pb_kits/playbook/plugins/pb_chart.js
2221
2220
  - app/pb_kits/playbook/tokens/_animation-curves.scss
2222
2221
  - app/pb_kits/playbook/tokens/_border_radius.scss
2223
2222
  - app/pb_kits/playbook/tokens/_colors.scss
@@ -1,145 +0,0 @@
1
- import React, { useState, useEffect } from "react";
2
- import { globalProps } from "../utilities/globalProps";
3
- import { buildAriaProps, buildDataProps } from "../utilities/props";
4
-
5
- import HighchartsReact from "highcharts-react-official";
6
- import Highcharts from "highcharts";
7
- import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
8
- import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
9
- import mapColors from "../pb_dashboard/pbChartsColorsHelper";
10
-
11
- import classnames from "classnames";
12
-
13
- type BarGraphProps = {
14
- align?: "left" | "right" | "center";
15
- axisTitle: string;
16
- dark?: Boolean;
17
- xAxisCategories: [];
18
- yAxisMin: number;
19
- yAxisMax: number;
20
- chartData: { name: string; data: number[] }[];
21
- className?: string;
22
- id: any;
23
- pointStart: number | any;
24
- subTitle?: string;
25
- title: string;
26
- type?: string;
27
- legend?: boolean;
28
- toggleLegendClick?: boolean;
29
- height?: string;
30
- colors: string[];
31
- layout?: "horizontal" | "vertical" | "proximate";
32
- verticalAlign?: "top" | "middle" | "bottom";
33
- x?: number;
34
- y?: number;
35
- aria?: { [key: string]: string };
36
- data?: { [key: string]: string };
37
- };
38
-
39
-
40
- const BarGraph = ({
41
- aria = {},
42
- data = {},
43
- align = "center",
44
- axisTitle,
45
- dark = false,
46
- chartData,
47
- className = "pb_bar_graph",
48
- colors,
49
- id,
50
- pointStart,
51
- subTitle,
52
- type = "column",
53
- title = "Title",
54
- xAxisCategories,
55
- yAxisMin,
56
- yAxisMax,
57
- legend = false,
58
- toggleLegendClick = true,
59
- height,
60
- layout = "horizontal",
61
- verticalAlign = "bottom",
62
- x = 0,
63
- y = 0,
64
- ...props
65
- }: BarGraphProps) => {
66
- const ariaProps = buildAriaProps(aria);
67
- const dataProps = buildDataProps(data);
68
- const setupTheme = () => {
69
- dark
70
- ? Highcharts.setOptions(highchartsDarkTheme)
71
- : Highcharts.setOptions(highchartsTheme);
72
- };
73
- setupTheme();
74
-
75
- const staticOptions = {
76
- title: {
77
- text: title,
78
- },
79
- chart: {
80
- height: height,
81
- type: type,
82
- },
83
- subtitle: {
84
- text: subTitle,
85
- },
86
- yAxis: {
87
- min: yAxisMin,
88
- max: yAxisMax,
89
- title: {
90
- text: axisTitle,
91
- },
92
- },
93
- xAxis: {
94
- categories: xAxisCategories,
95
- },
96
- legend: {
97
- enabled: legend,
98
- align: align,
99
- verticalAlign: verticalAlign,
100
- layout: layout,
101
- x: x,
102
- y: y,
103
- },
104
- colors:
105
- colors !== undefined && colors.length > 0
106
- ? mapColors(colors)
107
- : highchartsTheme.colors,
108
- plotOptions: {
109
- series: {
110
- pointStart: pointStart,
111
- events: {},
112
- dataLabels: {
113
- enabled: false,
114
- },
115
- },
116
- },
117
- series: chartData,
118
- credits: false,
119
- };
120
-
121
- if (!toggleLegendClick) {
122
- staticOptions.plotOptions.series.events = { legendItemClick: () => false };
123
- }
124
-
125
- const [options, setOptions] = useState({});
126
-
127
- useEffect(() => {
128
- setOptions({ ...staticOptions });
129
- }, [chartData]);
130
-
131
- return (
132
- <HighchartsReact
133
- containerProps={{
134
- className: classnames(globalProps(props), className),
135
- id: id,
136
- ...ariaProps,
137
- ...dataProps,
138
- }}
139
- highcharts={Highcharts}
140
- options={options}
141
- />
142
- );
143
- };
144
-
145
- export default BarGraph;
@@ -1,2 +0,0 @@
1
- declare module "*.scss"
2
- declare module "highcharts-react-official"