playbook_ui 7.0.1.pre.alpha12 → 7.0.1.pre.alpha14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -6
- data/app/pb_kits/playbook/_playbook.scss +1 -0
- data/app/pb_kits/playbook/data/menu.yml +1 -1
- data/app/pb_kits/playbook/index.js +3 -0
- data/app/pb_kits/playbook/packs/examples.js +6 -0
- data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +22 -6
- data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +5 -1
- data/app/pb_kits/playbook/pb_background/_background.html.erb +14 -0
- data/app/pb_kits/playbook/pb_background/_background.jsx +64 -0
- data/app/pb_kits/playbook/pb_background/_background.scss +15 -0
- data/app/pb_kits/playbook/pb_background/background.rb +36 -0
- data/app/pb_kits/playbook/pb_background/docs/_background_default.html.erb +41 -0
- data/app/pb_kits/playbook/pb_background/docs/_background_default.jsx +75 -0
- data/app/pb_kits/playbook/pb_background/docs/example.yml +8 -0
- data/app/pb_kits/playbook/pb_background/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_badge/_badge.jsx +4 -2
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +1 -1
- data/app/pb_kits/playbook/pb_button/_button.jsx +5 -1
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx +5 -1
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +2 -2
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +5 -2
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +3 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_options.html.erb +10 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +130 -0
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.scss +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +39 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +29 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +28 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +117 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +53 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +30 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +45 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +30 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +45 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +11 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +9 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +5 -1
- data/app/pb_kits/playbook/pb_contact/_contact.jsx +5 -1
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +5 -1
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +5 -1
- data/app/pb_kits/playbook/pb_date/date.rb +2 -1
- data/app/pb_kits/playbook/pb_date/docs/_date_default.html.erb +8 -1
- data/app/pb_kits/playbook/pb_date/docs/_date_timezone.html.erb +51 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_timezone.md +6 -0
- data/app/pb_kits/playbook/pb_date/docs/_description.md +2 -0
- data/app/pb_kits/playbook/pb_date/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +7 -4
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +0 -4
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -3
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +8 -10
- data/app/pb_kits/playbook/pb_date_picker/docs/{_date_picker_read_only.html.erb → _date_picker_allow_input.html.erb} +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.jsx +13 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.jsx +34 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.md +3 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +3 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_calendar_input_icon.scss +1 -0
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.jsx +5 -1
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx +5 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx +2 -2
- data/app/pb_kits/playbook/pb_flex/_flex.jsx +2 -2
- data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +6 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +3 -2
- data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +1 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.jsx +2 -2
- data/app/pb_kits/playbook/pb_icon/_icon.jsx +2 -2
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +5 -1
- data/app/pb_kits/playbook/pb_image/_image.jsx +5 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +5 -1
- data/app/pb_kits/playbook/pb_layout/_layout.jsx +4 -4
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +1 -1
- data/app/pb_kits/playbook/pb_list/_list.jsx +3 -2
- data/app/pb_kits/playbook/pb_list/_list_item.jsx +3 -2
- data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +5 -1
- data/app/pb_kits/playbook/pb_message/_message.jsx +5 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +5 -2
- data/app/pb_kits/playbook/pb_nav/_nav.jsx +2 -2
- data/app/pb_kits/playbook/pb_person/_person.jsx +5 -1
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +5 -1
- data/app/pb_kits/playbook/pb_popover/_popover.jsx +5 -1
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +4 -4
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +1 -1
- data/app/pb_kits/playbook/pb_radio/_radio.html.erb +1 -1
- data/app/pb_kits/playbook/pb_radio/docs/_radio_options.html.erb +9 -0
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_radio/radio.rb +2 -4
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +1 -1
- data/app/pb_kits/playbook/pb_select/_select.scss +1 -1
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +2 -2
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.jsx +3 -3
- data/app/pb_kits/playbook/pb_stat_value/docs/_stat_value_default.jsx +6 -1
- data/app/pb_kits/playbook/pb_table/_table.jsx +2 -2
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +17 -8
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +1 -1
- data/app/pb_kits/playbook/pb_time/_time.html.erb +23 -17
- data/app/pb_kits/playbook/pb_time/_time.jsx +22 -13
- data/app/pb_kits/playbook/pb_time/_time.scss +16 -8
- data/app/pb_kits/playbook/pb_time/docs/_time_align.html.erb +18 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_align.jsx +3 -3
- data/app/pb_kits/playbook/pb_time/docs/_time_default.html.erb +47 -3
- data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +33 -4
- data/app/pb_kits/playbook/pb_time/docs/_time_sizes.html.erb +11 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_sizes.jsx +19 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.html.erb +3 -1
- data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.jsx +0 -7
- data/app/pb_kits/playbook/pb_time/docs/_time_timezone.html.erb +38 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_timezone.jsx +12 -14
- data/app/pb_kits/playbook/pb_time/docs/example.yml +6 -2
- data/app/pb_kits/playbook/pb_time/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_time/time.rb +14 -2
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +1 -1
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.jsx +3 -3
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +1 -1
- data/app/pb_kits/playbook/pb_title/_title.jsx +5 -1
- data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +5 -1
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +1 -1
- data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +3 -3
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +41 -43
- data/app/pb_kits/playbook/pb_toggle/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_toggle/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_toggle/toggle.rb +2 -2
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +60 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +20 -3
- data/app/pb_kits/playbook/pb_typeahead/components/Control.jsx +30 -0
- data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.jsx +13 -0
- data/app/pb_kits/playbook/pb_typeahead/components/MenuList.jsx +12 -0
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +51 -0
- data/app/pb_kits/playbook/pb_typeahead/components/Option.jsx +34 -0
- data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.jsx +13 -0
- data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.jsx +13 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx +22 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx +29 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +84 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_summary.jsx +45 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx +101 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_summary.jsx +27 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +8 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +4 -0
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +5 -2
- data/app/pb_kits/playbook/plugins/pb_chart.js +1 -1
- data/app/pb_kits/playbook/tokens/_typography.scss +3 -3
- data/lib/generators/kit/templates/kit_jsx.erb.tt +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +50 -8
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.jsx +0 -13
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.md +0 -1
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_size.html.erb +0 -11
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_size.jsx +0 -44
@@ -0,0 +1 @@
|
|
1
|
+
export { default as BackgroundDefault } from './_background_default.jsx'
|
@@ -32,8 +32,10 @@ const Badge = (props: BadgeProps) => {
|
|
32
32
|
const ariaProps = buildAriaProps(aria)
|
33
33
|
const dataProps = buildDataProps(data)
|
34
34
|
const css = classnames(
|
35
|
-
buildCss('pb_badge_kit', variant, { rounded
|
36
|
-
globalProps(props)
|
35
|
+
buildCss('pb_badge_kit', variant, { rounded }),
|
36
|
+
globalProps(props),
|
37
|
+
className
|
38
|
+
)
|
37
39
|
|
38
40
|
return (
|
39
41
|
<div
|
@@ -82,7 +82,11 @@ const Button = (props: ButtonPropTypes) => {
|
|
82
82
|
} = props
|
83
83
|
|
84
84
|
const buttonAria = buttonAriaProps(props)
|
85
|
-
const css = classnames(
|
85
|
+
const css = classnames(
|
86
|
+
buttonClassName(props),
|
87
|
+
globalProps(props),
|
88
|
+
className
|
89
|
+
)
|
86
90
|
const loadingIcon = (
|
87
91
|
<div className="loading-icon">
|
88
92
|
<Icon
|
@@ -35,7 +35,11 @@ const ButtonToolbar = (props: ButtonToolbarProps) => {
|
|
35
35
|
const ariaProps = buildAriaProps(aria)
|
36
36
|
const dataProps = buildDataProps(data)
|
37
37
|
|
38
|
-
const classes = classnames(
|
38
|
+
const classes = classnames(
|
39
|
+
buildCss('pb_button_toolbar_kit', orientation, { connected }),
|
40
|
+
globalProps(props),
|
41
|
+
className
|
42
|
+
)
|
39
43
|
|
40
44
|
return (
|
41
45
|
<div
|
@@ -40,8 +40,11 @@ const Checkbox = (props: CheckboxProps) => {
|
|
40
40
|
|
41
41
|
const dataProps = buildDataProps(data)
|
42
42
|
const ariaProps = buildAriaProps(aria)
|
43
|
-
const classes = classnames(
|
44
|
-
{ checked
|
43
|
+
const classes = classnames(
|
44
|
+
buildCss('pb_checkbox_kit', { checked, error }),
|
45
|
+
globalProps(props),
|
46
|
+
className
|
47
|
+
)
|
45
48
|
|
46
49
|
return (
|
47
50
|
<label
|
@@ -15,6 +15,8 @@ module Playbook
|
|
15
15
|
prop :value
|
16
16
|
prop :name
|
17
17
|
|
18
|
+
prop :input_options, type: Playbook::Props::Hash,
|
19
|
+
default: {}
|
18
20
|
prop :required, type: Playbook::Props::Boolean,
|
19
21
|
default: false
|
20
22
|
prop :form_spacing, type: Playbook::Props::Boolean,
|
@@ -29,7 +31,7 @@ module Playbook
|
|
29
31
|
end
|
30
32
|
|
31
33
|
def input
|
32
|
-
check_box_tag(name, value, checked)
|
34
|
+
check_box_tag(name, value, checked, input_options)
|
33
35
|
end
|
34
36
|
|
35
37
|
def checkbox_label_status
|
@@ -0,0 +1,130 @@
|
|
1
|
+
/* @flow */
|
2
|
+
|
3
|
+
import React, { useEffect, useRef } from 'react'
|
4
|
+
import { pbChart } from '../'
|
5
|
+
import { globalProps } from '../utilities/globalProps'
|
6
|
+
import classnames from 'classnames'
|
7
|
+
import Highcharts from 'highcharts'
|
8
|
+
|
9
|
+
import { buildAriaProps, buildDataProps } from '../utilities/props'
|
10
|
+
|
11
|
+
type CircleChartProps = {
|
12
|
+
aria: Object,
|
13
|
+
chartData?: array,
|
14
|
+
children: Node,
|
15
|
+
className?: string,
|
16
|
+
colors: array,
|
17
|
+
data?: Object,
|
18
|
+
dataLabelHtml: string,
|
19
|
+
dataLabels: boolean,
|
20
|
+
headerFormat: string,
|
21
|
+
id?: string,
|
22
|
+
innerSize: "sm" | "md" | "lg" | "none",
|
23
|
+
legend: boolean,
|
24
|
+
maxPointSize: number,
|
25
|
+
minPointSize: number,
|
26
|
+
rounded: boolean,
|
27
|
+
startAngle: number,
|
28
|
+
style: string,
|
29
|
+
title: string,
|
30
|
+
tooltipHtml: string,
|
31
|
+
useHtml: boolean,
|
32
|
+
zMin: number,
|
33
|
+
}
|
34
|
+
|
35
|
+
const CircleChart = (props: CircleChartProps) => {
|
36
|
+
const {
|
37
|
+
aria = {},
|
38
|
+
chartData = [{}],
|
39
|
+
children,
|
40
|
+
className,
|
41
|
+
colors = [],
|
42
|
+
data = {},
|
43
|
+
dataLabelHtml = '<div>{point.name}</div>',
|
44
|
+
dataLabels = false,
|
45
|
+
headerFormat = null,
|
46
|
+
id,
|
47
|
+
innerSize = 'md',
|
48
|
+
legend = false,
|
49
|
+
maxPointSize = null,
|
50
|
+
minPointSize = null,
|
51
|
+
rounded = false,
|
52
|
+
startAngle = null,
|
53
|
+
style = 'pie',
|
54
|
+
title = '',
|
55
|
+
tooltipHtml = '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' +
|
56
|
+
'<b>{point.y}</b>',
|
57
|
+
useHtml = false,
|
58
|
+
zMin = null,
|
59
|
+
} = props
|
60
|
+
|
61
|
+
const ariaProps = buildAriaProps(aria)
|
62
|
+
const dataProps = buildDataProps(data)
|
63
|
+
const innerSizes = { sm: '35%', md: '50%', lg: '85%', none: '0%' }
|
64
|
+
const innerSizeFormat = (size) => innerSizes[size]
|
65
|
+
const roundedBorderWidth = rounded ? 20 : null
|
66
|
+
const roundedBorderColor = rounded ? null : ''
|
67
|
+
|
68
|
+
// Runs first time component Renders
|
69
|
+
useEffect(() => {
|
70
|
+
const formattedChartData = chartData.map((obj) => {
|
71
|
+
obj.y = obj.value
|
72
|
+
delete obj.value
|
73
|
+
return obj
|
74
|
+
})
|
75
|
+
|
76
|
+
new pbChart('.selector', {
|
77
|
+
id,
|
78
|
+
colors,
|
79
|
+
borderColor: roundedBorderColor,
|
80
|
+
borderWidth: roundedBorderWidth,
|
81
|
+
chartData: formattedChartData,
|
82
|
+
title,
|
83
|
+
type: style,
|
84
|
+
showInLegend: legend,
|
85
|
+
dataLabelHtml,
|
86
|
+
dataLabels,
|
87
|
+
headerFormat,
|
88
|
+
tooltipHtml,
|
89
|
+
useHTML: useHtml,
|
90
|
+
minPointSize,
|
91
|
+
maxPointSize,
|
92
|
+
innerSize: innerSizeFormat(innerSize),
|
93
|
+
zMin,
|
94
|
+
startAngle,
|
95
|
+
})
|
96
|
+
}, [])
|
97
|
+
|
98
|
+
const componentDidMount = useRef(false)
|
99
|
+
|
100
|
+
// Doesn't run the first time but runs every subsequent render
|
101
|
+
useEffect(() => {
|
102
|
+
if (componentDidMount.current) {
|
103
|
+
Highcharts.charts.forEach((chart) => {
|
104
|
+
if (chart.renderTo.id === id) {
|
105
|
+
const updatedValueArray = chartData.map((obj) => {
|
106
|
+
return obj.value
|
107
|
+
})
|
108
|
+
chart.series[0].setData(updatedValueArray)
|
109
|
+
}
|
110
|
+
})
|
111
|
+
} else {
|
112
|
+
componentDidMount.current = true
|
113
|
+
}
|
114
|
+
}, [chartData])
|
115
|
+
return (
|
116
|
+
<div id={`wrapper-circle-chart-${id}`}>
|
117
|
+
<div
|
118
|
+
id={id}
|
119
|
+
{...ariaProps}
|
120
|
+
{...dataProps}
|
121
|
+
className={classnames('pb_circle_chart', globalProps(props), className)}
|
122
|
+
/>
|
123
|
+
<If condition={children}>
|
124
|
+
<div className="pb-circle-chart-block">{children}</div>
|
125
|
+
</If>
|
126
|
+
</div>
|
127
|
+
)
|
128
|
+
}
|
129
|
+
|
130
|
+
export default CircleChart
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { CircleChart, Title } from '../../'
|
3
|
+
|
4
|
+
const dataWithABlock = [
|
5
|
+
{
|
6
|
+
name: 'Waiting for Calls',
|
7
|
+
value: 41,
|
8
|
+
},
|
9
|
+
{
|
10
|
+
name: 'On Call',
|
11
|
+
value: 49,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
name: 'After call',
|
15
|
+
value: 10,
|
16
|
+
},
|
17
|
+
]
|
18
|
+
|
19
|
+
const CircleChartBlock = () => (
|
20
|
+
|
21
|
+
<div>
|
22
|
+
<CircleChart
|
23
|
+
chartData={dataWithABlock}
|
24
|
+
id="chart-with-a-block"
|
25
|
+
innerSize="lg"
|
26
|
+
marginTop="xl"
|
27
|
+
rounded
|
28
|
+
>
|
29
|
+
<Title
|
30
|
+
size={1}
|
31
|
+
tag="div"
|
32
|
+
>
|
33
|
+
{'83'}
|
34
|
+
</Title>
|
35
|
+
</CircleChart>
|
36
|
+
</div>
|
37
|
+
)
|
38
|
+
|
39
|
+
export default CircleChartBlock
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { CircleChart } from '../../'
|
3
|
+
|
4
|
+
const dataWithColors = [
|
5
|
+
{
|
6
|
+
name: 'Waiting for Calls',
|
7
|
+
value: 41,
|
8
|
+
},
|
9
|
+
{
|
10
|
+
name: 'On Call',
|
11
|
+
value: 49,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
name: 'After call',
|
15
|
+
value: 10,
|
16
|
+
},
|
17
|
+
]
|
18
|
+
|
19
|
+
const CircleChartColors = () => (
|
20
|
+
<div>
|
21
|
+
<CircleChart
|
22
|
+
chartData={dataWithColors}
|
23
|
+
colors={['data-6', 'data-4', 'data-2']}
|
24
|
+
id="colors-example"
|
25
|
+
/>
|
26
|
+
</div>
|
27
|
+
)
|
28
|
+
|
29
|
+
export default CircleChartColors
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { CircleChart } from '../../'
|
3
|
+
|
4
|
+
const data = [
|
5
|
+
{
|
6
|
+
name: 'Waiting for Calls',
|
7
|
+
value: 41,
|
8
|
+
},
|
9
|
+
{
|
10
|
+
name: 'On Call',
|
11
|
+
value: 49,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
name: 'After call',
|
15
|
+
value: 10,
|
16
|
+
},
|
17
|
+
]
|
18
|
+
|
19
|
+
const CircleChartDefault = () => (
|
20
|
+
<div>
|
21
|
+
<CircleChart
|
22
|
+
chartData={data}
|
23
|
+
id="circle-chart-default"
|
24
|
+
/>
|
25
|
+
</div>
|
26
|
+
)
|
27
|
+
|
28
|
+
export default CircleChartDefault
|
@@ -0,0 +1,117 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { CircleChart } from '../../'
|
3
|
+
|
4
|
+
const dataFirst = [
|
5
|
+
{
|
6
|
+
name: 'Bugs',
|
7
|
+
value: 8,
|
8
|
+
},
|
9
|
+
{
|
10
|
+
name: 'Chores',
|
11
|
+
value: 1,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
name: 'Stories',
|
15
|
+
value: 12,
|
16
|
+
},
|
17
|
+
]
|
18
|
+
|
19
|
+
const dataSecond = [
|
20
|
+
{
|
21
|
+
name: 'Queued',
|
22
|
+
value: 7,
|
23
|
+
},
|
24
|
+
{
|
25
|
+
name: 'In Progress',
|
26
|
+
value: 6,
|
27
|
+
},
|
28
|
+
{
|
29
|
+
name: 'Validation',
|
30
|
+
value: 3,
|
31
|
+
},
|
32
|
+
{
|
33
|
+
name: 'Done',
|
34
|
+
value: 6,
|
35
|
+
},
|
36
|
+
]
|
37
|
+
|
38
|
+
const dataThird = [
|
39
|
+
{
|
40
|
+
name: '1 Point Tickets',
|
41
|
+
value: 2,
|
42
|
+
},
|
43
|
+
{
|
44
|
+
name: '3 Point Tickets',
|
45
|
+
value: 5,
|
46
|
+
},
|
47
|
+
{
|
48
|
+
name: '5 Point Tickets',
|
49
|
+
value: 6,
|
50
|
+
},
|
51
|
+
{
|
52
|
+
name: '8 Point Tickets',
|
53
|
+
value: 3,
|
54
|
+
},
|
55
|
+
{
|
56
|
+
name: '13 Point Tickets',
|
57
|
+
value: 1,
|
58
|
+
},
|
59
|
+
]
|
60
|
+
const dataFourth = [
|
61
|
+
{
|
62
|
+
name: 'Facebook',
|
63
|
+
value: 2498,
|
64
|
+
},
|
65
|
+
{
|
66
|
+
name: 'YouTube',
|
67
|
+
value: 2000,
|
68
|
+
},
|
69
|
+
{
|
70
|
+
name: 'WhatsApp',
|
71
|
+
value: 2000,
|
72
|
+
},
|
73
|
+
{
|
74
|
+
name: 'Facebook Messenger',
|
75
|
+
value: 1300,
|
76
|
+
},
|
77
|
+
{
|
78
|
+
name: 'WeChat',
|
79
|
+
value: 1165,
|
80
|
+
},
|
81
|
+
{
|
82
|
+
name: 'Instagram',
|
83
|
+
value: 1000,
|
84
|
+
},
|
85
|
+
{
|
86
|
+
name: 'Tik Tok',
|
87
|
+
value: 800,
|
88
|
+
},
|
89
|
+
]
|
90
|
+
|
91
|
+
const CircleChartInnerSizes = () => (
|
92
|
+
<div>
|
93
|
+
<CircleChart
|
94
|
+
chartData={dataFirst}
|
95
|
+
id="with-innersize-sm"
|
96
|
+
innerSize="sm"
|
97
|
+
/>
|
98
|
+
<CircleChart
|
99
|
+
chartData={dataSecond}
|
100
|
+
id="with-innersize-md"
|
101
|
+
innerSize="md"
|
102
|
+
/>
|
103
|
+
<CircleChart
|
104
|
+
chartData={dataThird}
|
105
|
+
id="with-innersize-lg"
|
106
|
+
innerSize="lg"
|
107
|
+
/>
|
108
|
+
<CircleChart
|
109
|
+
chartData={dataFourth}
|
110
|
+
className="poop"
|
111
|
+
id="with-innersize-none "
|
112
|
+
innerSize="none"
|
113
|
+
/>
|
114
|
+
</div>
|
115
|
+
)
|
116
|
+
|
117
|
+
export default CircleChartInnerSizes
|