playbook_ui_docs 14.22.0.pre.alpha.popoverkittransitionpoppertofloatingui8781 → 14.22.0.pre.alpha.testdialog8898

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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +1 -1
  3. data/app/pb_kits/playbook/pb_body/docs/_body_truncate.jsx +3 -3
  4. data/app/pb_kits/playbook/pb_body/docs/_body_truncate_react.md +4 -0
  5. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +71 -26
  6. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +29 -16
  7. data/app/pb_kits/playbook/pb_circle_chart/docs/{_circle_chart_colors.md → _circle_chart_colors_rails.md} +1 -1
  8. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +2 -0
  9. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +28 -16
  10. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +4 -2
  11. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +23 -15
  12. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +81 -51
  13. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +103 -75
  14. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +3 -6
  15. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +19 -13
  16. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +30 -17
  17. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +34 -20
  18. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +29 -20
  19. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +28 -20
  20. data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +1 -0
  21. data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +0 -1
  22. data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +0 -1
  23. data/app/pb_kits/playbook/pb_title/docs/_title_truncate.jsx +3 -3
  24. data/app/pb_kits/playbook/pb_title/docs/_title_truncate_react.md +4 -0
  25. data/dist/playbook-doc.js +2 -2
  26. metadata +9 -7
  27. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +0 -38
  28. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +0 -1
  29. /data/app/pb_kits/playbook/pb_body/docs/{_body_truncate.md → _body_truncate_rails.md} +0 -0
  30. /data/app/pb_kits/playbook/pb_title/docs/{_title_truncate.md → _title_truncate_rails.md} +0 -0
@@ -1,114 +1,142 @@
1
1
  import React from 'react'
2
-
3
- import CircleChart from '../_circle_chart'
4
-
2
+ import circleChartTheme from '../circleChartTheme'
3
+ import Highcharts from "highcharts"
4
+ import HighchartsReact from "highcharts-react-official"
5
5
  import Title from '../../pb_title/_title'
6
6
 
7
- const data = [
7
+ const dataFirst = [
8
8
  {
9
9
  name: 'Waiting for Calls',
10
- value: 41,
10
+ y: 41,
11
11
  },
12
12
  {
13
13
  name: 'On Call',
14
- value: 49,
14
+ y: 49,
15
15
  },
16
16
  {
17
17
  name: 'After Call',
18
- value: 10,
18
+ y: 10,
19
19
  },
20
20
  ]
21
21
 
22
- const dataFirst = [{
22
+ const dataSecond = [{
23
23
  name: 'Bugs',
24
- value: 8,
25
-
24
+ y: 8,
26
25
  },
27
26
  {
28
27
  name: 'Chores',
29
- value: 1,
30
-
28
+ y: 1,
31
29
  },
32
30
  {
33
31
  name: 'Stories',
34
- value: 12,
35
- },
36
- ]
32
+ y: 12,
33
+ }]
37
34
 
38
- const dataSecond = [
35
+ const dataThird = [
39
36
  {
40
37
  name: 'Queued',
41
- value: 7,
38
+ y: 7,
42
39
  },
43
40
  {
44
41
  name: 'In Progress',
45
- value: 6,
42
+ y: 6,
46
43
  },
47
44
  {
48
45
  name: 'Validation',
49
- value: 3,
46
+ y: 3,
50
47
  },
51
48
  {
52
49
  name: 'Done',
53
- value: 6,
50
+ y: 6,
54
51
  },
55
52
  ]
56
53
 
54
+ const CircleChartLegendPosition = (props) => {
55
+ const chartOptionsFirst = {
56
+ title: { text: "Alignment of Legend" },
57
+ series: [{ data: dataFirst }],
58
+ legend: {
59
+ align: 'right',
60
+ verticalAlign: 'top'
61
+ },
62
+ plotOptions: {
63
+ pie: {
64
+ showInLegend: true
65
+ }
66
+ }
67
+ }
68
+
69
+ const chartOptionsSecond = {
70
+ title: { text: "Layout of Legend" },
71
+ series: [{ data: dataSecond }],
72
+ legend: {
73
+ layout: 'vertical'
74
+ },
75
+ plotOptions: {
76
+ pie: {
77
+ showInLegend: true
78
+ }
79
+ }
80
+ }
81
+
82
+ const chartOptionsThird = {
83
+ title: { text: "Offset of Legend" },
84
+ series: [{ data: dataThird }],
85
+ legend: {
86
+ layout: 'vertical',
87
+ x: 100,
88
+ y: 10
89
+ },
90
+ plotOptions: {
91
+ pie: {
92
+ showInLegend: true
93
+ }
94
+ }
95
+ }
96
+
97
+ const optionsFirst = Highcharts.merge({}, circleChartTheme, chartOptionsFirst)
98
+ const optionsSecond = Highcharts.merge({}, circleChartTheme, chartOptionsSecond)
99
+ const optionsThird = Highcharts.merge({}, circleChartTheme, chartOptionsThird)
57
100
 
58
- const CircleChartLegendPosition = (props) => (
59
- <div>
60
- <Title
61
- paddingBottom="sm"
62
- paddingTop="sm"
63
- size={4}
64
- tag="h4"
65
- text="align | verticalAlign"
66
- />
67
- <CircleChart
68
- align='right'
69
- chartData={data}
70
- id="legend-position-circle"
71
- legend
72
- paddingBottom="sm"
73
- title="Alignment of Legend"
74
- verticalAlign="top"
75
- {...props}
76
- />
77
- <Title
78
- paddingBottom="sm"
79
- paddingTop="sm"
80
- size={4}
81
- tag="h4"
82
- text="layout"
83
- />
84
- <CircleChart
85
- chartData={dataFirst}
86
- id="legend-position-circle-1"
87
- layout="vertical"
88
- legend
89
- paddingBottom="sm"
90
- paddingTop="sm"
91
- title="Layout of Legend"
92
- {...props}
93
- />
94
- <Title
95
- paddingBottom="sm"
96
- paddingTop="sm"
97
- size={4}
98
- tag="h4"
99
- text="x | y"
100
- />
101
- <CircleChart
102
- chartData={dataSecond}
103
- id="legend-position-circle-2"
104
- layout="vertical"
105
- legend
106
- title="Offset of Legend"
107
- x={100}
108
- y={10}
109
- {...props}
110
- />
111
- </div>
112
- )
101
+ return (
102
+ <div>
103
+ <Title
104
+ paddingY="sm"
105
+ size={4}
106
+ tag="h4"
107
+ text="align | verticalAlign"
108
+ {...props}
109
+ />
110
+ <HighchartsReact
111
+ highcharts={Highcharts}
112
+ options={optionsFirst}
113
+ />
114
+
115
+ <Title
116
+ paddingY="sm"
117
+ size={4}
118
+ tag="h4"
119
+ text="layout"
120
+ {...props}
121
+ />
122
+ <HighchartsReact
123
+ highcharts={Highcharts}
124
+ options={optionsSecond}
125
+ />
126
+
127
+ <Title
128
+ paddingY="sm"
129
+ size={4}
130
+ tag="h4"
131
+ text="x | y"
132
+ {...props}
133
+ />
134
+ <HighchartsReact
135
+ highcharts={Highcharts}
136
+ options={optionsThird}
137
+ />
138
+ </div>
139
+ )
140
+ }
113
141
 
114
142
  export default CircleChartLegendPosition
@@ -6,12 +6,9 @@
6
6
  `x` **Type**: Number (defaults to 0)
7
7
  `y` **Type**: Number (defaults to 0)
8
8
 
9
- -
10
-
11
- - `layout` determines the position of the legend items
9
+ `layout` determines the position of the legend items
12
10
  `layout: proximate` will place the legend items as close as possible to the graphs they're representing. It will also determine whether to place the legend above/below or on the side of the plot area, if the legend is in a corner.
13
11
 
14
- - `x` offsets the legend relative to its horizontal alignmnet. Negative x moves it to the left, positive x moves it to the right
15
-
12
+ `x` offsets the legend relative to its horizontal alignment. Negative x moves it to the left, positive x moves it to the right
16
13
 
17
- - `y` offsets the legend relative to its vertical alignmnet. Negative y moves it up, positive y moves it down.
14
+ `y` offsets the legend relative to its vertical alignment. Negative y moves it up, positive y moves it down.
@@ -1,36 +1,37 @@
1
1
  import React, { useState } from 'react'
2
-
3
- import CircleChart from '../_circle_chart'
2
+ import circleChartTheme from '../circleChartTheme'
3
+ import Highcharts from "highcharts"
4
+ import HighchartsReact from "highcharts-react-official"
4
5
  import Button from '../../pb_button/_button'
5
6
 
6
7
  const CircleChartLiveData = (props) => {
7
8
  const [data, setData] = useState([
8
9
  {
9
10
  name: 'Waiting for Calls',
10
- value: 41,
11
+ y: 41,
11
12
  },
12
13
  {
13
14
  name: 'On Call',
14
- value: 49,
15
+ y: 49,
15
16
  },
16
17
  {
17
18
  name: 'After Call',
18
- value: 10,
19
+ y: 10,
19
20
  },
20
21
  ])
21
22
 
22
23
  const data2 = [
23
24
  {
24
25
  name: 'Waiting for Calls',
25
- value: 48,
26
+ y: 48,
26
27
  },
27
28
  {
28
29
  name: 'On Call',
29
- value: 12,
30
+ y: 12,
30
31
  },
31
32
  {
32
33
  name: 'After Call',
33
- value: 140,
34
+ y: 140,
34
35
  },
35
36
  ]
36
37
 
@@ -38,6 +39,12 @@ const CircleChartLiveData = (props) => {
38
39
  setData(data2)
39
40
  }
40
41
 
42
+ const chartOptions = {
43
+ series: [{ data: data }],
44
+ }
45
+
46
+ const options = Highcharts.merge({}, circleChartTheme, chartOptions)
47
+
41
48
  return (
42
49
  <div>
43
50
  <Button
@@ -45,13 +52,12 @@ const CircleChartLiveData = (props) => {
45
52
  text="Update Value"
46
53
  {...props}
47
54
  />
48
- <CircleChart
49
- chartData={data}
50
- id="circle-chart-live-data"
51
- {...props}
55
+ <HighchartsReact
56
+ highcharts={Highcharts}
57
+ options={options}
52
58
  />
53
59
  </div>
54
60
  )
55
61
  }
56
62
 
57
- export default CircleChartLiveData
63
+ export default CircleChartLiveData
@@ -1,32 +1,45 @@
1
1
  import React from 'react'
2
-
3
- import CircleChart from '../_circle_chart'
2
+ import circleChartTheme from '../circleChartTheme'
3
+ import Highcharts from "highcharts"
4
+ import HighchartsReact from "highcharts-react-official"
4
5
 
5
6
  const dataRounded = [
6
7
  {
7
8
  name: 'Waiting for Calls',
8
- value: 41,
9
+ y: 41,
9
10
  },
10
11
  {
11
12
  name: 'On Call',
12
- value: 49,
13
+ y: 49,
13
14
  },
14
15
  {
15
16
  name: 'After Call',
16
- value: 10,
17
+ y: 10,
17
18
  },
18
19
  ]
19
20
 
20
- const CircleChartRounded = (props) => (
21
- <div>
22
- <CircleChart
23
- chartData={dataRounded}
24
- id="default-test-rounded"
25
- innerSize="lg"
26
- rounded
27
- {...props}
28
- />
29
- </div>
30
- )
21
+ const CircleChartRounded = () => {
22
+ const chartOptions = {
23
+ series: [{ data: dataRounded }],
24
+ plotOptions: {
25
+ pie: {
26
+ borderColor: null,
27
+ borderWidth: 20,
28
+ innerSize: '100%',
29
+ },
30
+ },
31
+ }
32
+
33
+ const options = Highcharts.merge({}, circleChartTheme, chartOptions)
34
+
35
+ return (
36
+ <div>
37
+ <HighchartsReact
38
+ highcharts={Highcharts}
39
+ options={options}
40
+ />
41
+ </div>
42
+ )
43
+ }
31
44
 
32
- export default CircleChartRounded
45
+ export default CircleChartRounded
@@ -1,47 +1,61 @@
1
1
  import React from 'react'
2
-
3
- import CircleChart from '../_circle_chart'
2
+ import circleChartTheme from '../circleChartTheme'
3
+ import Highcharts from "highcharts"
4
+ import HighchartsReact from "highcharts-react-official"
4
5
 
5
6
  const dataWithLabels = [
6
7
  {
7
8
  name: 'Facebook',
8
- value: 2498,
9
+ y: 2498,
9
10
  },
10
11
  {
11
12
  name: 'YouTube',
12
- value: 2000,
13
+ y: 2000,
13
14
  },
14
15
  {
15
16
  name: 'WhatsApp',
16
- value: 2000,
17
+ y: 2000,
17
18
  },
18
19
  {
19
20
  name: 'Facebook Messenger',
20
- value: 1300,
21
+ y: 1300,
21
22
  },
22
23
  {
23
24
  name: 'WeChat',
24
- value: 1165,
25
+ y: 1165,
25
26
  },
26
27
  {
27
28
  name: 'Instagram',
28
- value: 1000,
29
+ y: 1000,
29
30
  },
30
31
  {
31
32
  name: 'Tik Tok',
32
- value: 800,
33
+ y: 800,
33
34
  },
34
35
  ]
35
36
 
36
- const CircleChartWithLabels = (props) => (
37
- <div>
38
- <CircleChart
39
- chartData={dataWithLabels}
40
- dataLabels
41
- id="with-labels-example"
42
- {...props}
43
- />
44
- </div>
45
- )
37
+ const CircleChartWithLabels = () => {
38
+ const chartOptions = {
39
+ series: [{ data: dataWithLabels }],
40
+ plotOptions: {
41
+ pie: {
42
+ dataLabels: {
43
+ enabled: true,
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+ const options = Highcharts.merge({}, circleChartTheme, chartOptions)
50
+
51
+ return (
52
+ <div>
53
+ <HighchartsReact
54
+ highcharts={Highcharts}
55
+ options={options}
56
+ />
57
+ </div>
58
+ )
59
+ }
46
60
 
47
- export default CircleChartWithLabels
61
+ export default CircleChartWithLabels
@@ -1,32 +1,41 @@
1
1
  import React from 'react'
2
-
3
- import CircleChart from '../_circle_chart'
2
+ import circleChartTheme from '../circleChartTheme'
3
+ import Highcharts from "highcharts"
4
+ import HighchartsReact from "highcharts-react-official"
4
5
 
5
6
  const dataWithLegend = [{
6
7
  name: 'Bugs',
7
- value: 8,
8
-
8
+ y: 8,
9
9
  },
10
10
  {
11
11
  name: 'Chores',
12
- value: 1,
13
-
12
+ y: 1,
14
13
  },
15
14
  {
16
15
  name: 'Stories',
17
- value: 12,
18
- },
19
- ]
16
+ y: 12,
17
+ }]
18
+
19
+ const CircleChartWithLegendKit = () => {
20
+ const chartOptions = {
21
+ series: [{ data: dataWithLegend }],
22
+ plotOptions: {
23
+ pie: {
24
+ showInLegend: true
25
+ }
26
+ }
27
+ }
28
+
29
+ const options = Highcharts.merge({}, circleChartTheme, chartOptions)
20
30
 
21
- const CircleChartWithLegendKit = (props) => (
22
- <div>
23
- <CircleChart
24
- chartData={dataWithLegend}
25
- id="with-legend-example"
26
- legend
27
- {...props}
28
- />
29
- </div>
30
- )
31
+ return (
32
+ <div>
33
+ <HighchartsReact
34
+ highcharts={Highcharts}
35
+ options={options}
36
+ />
37
+ </div>
38
+ )
39
+ }
31
40
 
32
- export default CircleChartWithLegendKit
41
+ export default CircleChartWithLegendKit
@@ -1,47 +1,55 @@
1
1
  import React from 'react'
2
-
3
- import CircleChart from '../_circle_chart'
2
+ import circleChartTheme from '../circleChartTheme'
3
+ import Highcharts from "highcharts"
4
+ import HighchartsReact from "highcharts-react-official"
4
5
 
5
6
  const dataWithTitle = [
6
7
  {
7
8
  name: 'Facebook',
8
- value: 2498,
9
+ y: 2498,
9
10
  },
10
11
  {
11
12
  name: 'YouTube',
12
- value: 2000,
13
+ y: 2000,
13
14
  },
14
15
  {
15
16
  name: 'WhatsApp',
16
- value: 2000,
17
+ y: 2000,
17
18
  },
18
19
  {
19
20
  name: 'Facebook Messenger',
20
- value: 1300,
21
+ y: 1300,
21
22
  },
22
23
  {
23
24
  name: 'WeChat',
24
- value: 1165,
25
+ y: 1165,
25
26
  },
26
27
  {
27
28
  name: 'Instagram',
28
- value: 1000,
29
+ y: 1000,
29
30
  },
30
31
  {
31
32
  name: 'Tik Tok',
32
- value: 800,
33
+ y: 800,
33
34
  },
34
35
  ]
35
36
 
36
- const CircleChartWithLegendKit = (props) => (
37
- <div>
38
- <CircleChart
39
- chartData={dataWithTitle}
40
- id="with-title-example"
41
- title="Active Users on Social Media"
42
- {...props}
43
- />
44
- </div>
45
- )
37
+ const CircleChartWithTitle = () => {
38
+ const chartOptions = {
39
+ title: { text: "Active Users on Social Media" },
40
+ series: [{ data: dataWithTitle }],
41
+ }
42
+
43
+ const options = Highcharts.merge({}, circleChartTheme, chartOptions)
44
+
45
+ return (
46
+ <div>
47
+ <HighchartsReact
48
+ highcharts={Highcharts}
49
+ options={options}
50
+ />
51
+ </div>
52
+ )
53
+ }
46
54
 
47
- export default CircleChartWithLegendKit
55
+ export default CircleChartWithTitle
@@ -0,0 +1 @@
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 circleChartTheme.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.
@@ -14,7 +14,6 @@ examples:
14
14
 
15
15
  react:
16
16
  - circle_chart_default: Default Style
17
- - circle_chart_pb_styles: Playbook Styles
18
17
  - circle_chart_live_data: Live Data
19
18
  - circle_chart_rounded: Rounded Corners
20
19
  - circle_chart_block: Accepts Any Block
@@ -9,4 +9,3 @@ export { default as CircleChartLegendPosition } from './_circle_chart_legend_pos
9
9
  export { default as CircleChartWithTitle } from './_circle_chart_with_title.jsx'
10
10
  export { default as CircleChartInnerSizes } from './_circle_chart_inner_sizes.jsx'
11
11
  export { default as CircleChartCustomTooltip } from "./_circle_chart_custom_tooltip.jsx"
12
- export { default as CircleChartPbStyles } from "./_circle_chart_pb_styles.jsx"
@@ -20,7 +20,7 @@ const TitleTruncate = (props) => {
20
20
  marginBottom="md"
21
21
  size={4}
22
22
  text={lorem}
23
- truncate="1"
23
+ truncate={1}
24
24
  {...props}
25
25
  />
26
26
 
@@ -32,7 +32,7 @@ const TitleTruncate = (props) => {
32
32
  marginBottom="md"
33
33
  size={4}
34
34
  text={lorem}
35
- truncate="2"
35
+ truncate={2}
36
36
  {...props}
37
37
  />
38
38
 
@@ -43,7 +43,7 @@ const TitleTruncate = (props) => {
43
43
  <Title
44
44
  size={4}
45
45
  text={lorem}
46
- truncate="3"
46
+ truncate={3}
47
47
  {...props}
48
48
  />
49
49
  </Flex>
@@ -0,0 +1,4 @@
1
+ ##### Prop
2
+ `truncate` | **Type**: Enum | **Values**: 1 | 2 | 3 | 4 | 5
3
+
4
+ The `truncate` prop truncates overflowing text up to a maximum of five rows and adds an ellipsis at the end.