playbook_ui 6.0.0 → 6.0.1.pre.alpha6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +2 -1
- data/app/pb_kits/playbook/data/menu.yml +3 -2
- data/app/pb_kits/playbook/index.js +1 -0
- data/app/pb_kits/playbook/packs/examples.js +2 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +2 -2
- data/app/pb_kits/playbook/pb_badge/_badge.jsx +2 -5
- data/app/pb_kits/playbook/pb_badge/_badge.scss +1 -1
- data/app/pb_kits/playbook/pb_badge/badge.rb +1 -6
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +2 -2
- data/app/pb_kits/playbook/pb_body/_body.jsx +3 -6
- data/app/pb_kits/playbook/pb_body/_body.scss +6 -0
- data/app/pb_kits/playbook/pb_body/body.rb +2 -8
- data/app/pb_kits/playbook/pb_button/_button.jsx +2 -5
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -1
- data/app/pb_kits/playbook/pb_button/button.rb +1 -7
- data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +2 -0
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +2 -2
- data/app/pb_kits/playbook/pb_card/_card.jsx +17 -14
- data/app/pb_kits/playbook/pb_card/_card.scss +4 -1
- data/app/pb_kits/playbook/pb_card/card.rb +2 -9
- data/app/pb_kits/playbook/pb_card/docs/_card_dark.html.erb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +2 -2
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +4 -8
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +2 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +0 -2
- data/app/pb_kits/playbook/pb_contact/_contact.jsx +2 -2
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +2 -2
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +26 -0
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +2 -2
- data/app/pb_kits/playbook/pb_date/_date.jsx +4 -4
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.jsx +2 -2
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +2 -2
- data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.jsx +2 -2
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +6 -2
- 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 +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +3 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_simple_form_validate.html.erb +3 -1
- data/app/pb_kits/playbook/pb_form/form_builder.rb +2 -0
- data/app/pb_kits/playbook/pb_form/form_builder/checkbox_field.rb +26 -0
- data/app/pb_kits/playbook/pb_form/form_builder/form_field_builder.rb +1 -0
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +2 -2
- data/app/pb_kits/playbook/pb_gauge/_gauge.html.erb +12 -0
- data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +110 -0
- data/app/pb_kits/playbook/pb_gauge/_gauge.scss +11 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb +11 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +17 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.html.erb +12 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +18 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb +14 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +20 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb +15 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +23 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +40 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb +15 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +21 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.md +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb +26 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +37 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.md +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb +14 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +20 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb +29 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +29 -0
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +24 -0
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +9 -0
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +57 -0
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.jsx +2 -2
- data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +2 -2
- 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_circle/_icon_circle.jsx +2 -2
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +2 -2
- data/app/pb_kits/playbook/pb_image/_image.jsx +2 -2
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +2 -2
- data/app/pb_kits/playbook/pb_label_value/_label_value.jsx +2 -2
- data/app/pb_kits/playbook/pb_layout/_layout.jsx +6 -6
- data/app/pb_kits/playbook/pb_legend/_legend.jsx +2 -2
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +2 -2
- data/app/pb_kits/playbook/pb_list/_list.jsx +2 -2
- data/app/pb_kits/playbook/pb_list/_list_item.jsx +2 -2
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.jsx +2 -2
- data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +111 -0
- data/app/pb_kits/playbook/pb_message/_message.jsx +2 -2
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +2 -2
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_nav/_nav.jsx +2 -2
- data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +2 -2
- data/app/pb_kits/playbook/pb_person/_person.jsx +2 -2
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +2 -2
- data/app/pb_kits/playbook/pb_pill/_pill.jsx +2 -2
- data/app/pb_kits/playbook/pb_popover/_popover.jsx +2 -2
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.jsx +2 -2
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +2 -2
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +2 -2
- data/app/pb_kits/playbook/pb_radio/_radio.jsx +2 -2
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +2 -2
- data/app/pb_kits/playbook/pb_select/_select.jsx +2 -2
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.jsx +2 -2
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +2 -2
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.jsx +2 -2
- data/app/pb_kits/playbook/pb_table/_table.jsx +2 -2
- data/app/pb_kits/playbook/pb_table/_table_row.jsx +2 -2
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +2 -2
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +2 -2
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +2 -2
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +2 -2
- data/app/pb_kits/playbook/pb_title/_title.jsx +2 -2
- data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +2 -2
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +2 -2
- data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +2 -2
- data/app/pb_kits/playbook/pb_user/_user.jsx +2 -2
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +2 -2
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx +2 -2
- data/app/pb_kits/playbook/plugins/pb_chart.js +74 -0
- data/app/pb_kits/playbook/props.rb +6 -0
- data/app/pb_kits/playbook/utilities/{spacing.js → globalProps.js} +14 -1
- data/app/pb_kits/playbook/utilities/props.js +1 -0
- data/lib/generators/kit/templates/kit_jsx.erb.tt +2 -2
- data/lib/playbook/version.rb +1 -1
- metadata +34 -6
@@ -2,7 +2,7 @@
|
|
2
2
|
import React from 'react'
|
3
3
|
import classnames from 'classnames'
|
4
4
|
import { buildCss } from '../utilities/props'
|
5
|
-
import {
|
5
|
+
import { globalProps } from '../utilities/globalProps.js'
|
6
6
|
|
7
7
|
type ProgressSimpleProps = {
|
8
8
|
align?: "left" | "center" | "right",
|
@@ -43,7 +43,7 @@ const ProgressSimple = (props: ProgressSimpleProps) => {
|
|
43
43
|
const wrapperClass = classnames(
|
44
44
|
className,
|
45
45
|
buildCss('pb_progress_simple_wrapper', align, { dark: dark }),
|
46
|
-
|
46
|
+
globalProps(props)
|
47
47
|
)
|
48
48
|
|
49
49
|
const kitClass = classnames(
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildCss } from '../utilities/props'
|
6
|
-
import {
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
type ProgressStepProps = {
|
9
9
|
className?: String,
|
@@ -33,7 +33,7 @@ const ProgressStep = (props: ProgressStepProps) => {
|
|
33
33
|
)
|
34
34
|
|
35
35
|
return (
|
36
|
-
<div className={classnames(progressStepCss, className,
|
36
|
+
<div className={classnames(progressStepCss, className, globalProps(props))}>
|
37
37
|
{children}
|
38
38
|
</div>
|
39
39
|
)
|
@@ -4,7 +4,7 @@
|
|
4
4
|
import React from 'react'
|
5
5
|
import Body from '../pb_body/_body.jsx'
|
6
6
|
import classnames from 'classnames'
|
7
|
-
import {
|
7
|
+
import { globalProps } from '../utilities/globalProps.js'
|
8
8
|
|
9
9
|
type RadioProps = {
|
10
10
|
className?: String,
|
@@ -40,7 +40,7 @@ const Radio = ({
|
|
40
40
|
|
41
41
|
return (
|
42
42
|
<label
|
43
|
-
className={classnames('pb_radio_kit' + (dark === true ? '_dark ' : ' ') + errorClass + ' ' + className,
|
43
|
+
className={classnames('pb_radio_kit' + (dark === true ? '_dark ' : ' ') + errorClass + ' ' + className, globalProps(props))}
|
44
44
|
htmlFor={id}
|
45
45
|
>
|
46
46
|
<If condition={children}>
|
@@ -3,7 +3,7 @@ import React from 'react'
|
|
3
3
|
import classnames from 'classnames'
|
4
4
|
import { Caption } from '../'
|
5
5
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
6
|
-
import {
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
type SectionSeparatorProps = {
|
9
9
|
aria: object,
|
@@ -30,7 +30,7 @@ const SectionSeparator = (props: SectionSeparatorProps) => {
|
|
30
30
|
const themeStyle = dark === true ? '_dark' : ''
|
31
31
|
const ariaProps = buildAriaProps(aria)
|
32
32
|
const dataProps = buildDataProps(data)
|
33
|
-
const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation, themeStyle), className,
|
33
|
+
const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation, themeStyle), className, globalProps(props))
|
34
34
|
|
35
35
|
return (
|
36
36
|
|
@@ -14,7 +14,7 @@ import {
|
|
14
14
|
buildDataProps,
|
15
15
|
} from '../utilities/props'
|
16
16
|
|
17
|
-
import {
|
17
|
+
import { globalProps } from '../utilities/globalProps.js'
|
18
18
|
|
19
19
|
import type { InputCallback } from '../types'
|
20
20
|
|
@@ -72,7 +72,7 @@ const Select = ({
|
|
72
72
|
...props
|
73
73
|
}: SelectProps) => {
|
74
74
|
const errorClass = error ? ' error' : ''
|
75
|
-
const css = classnames(buildCss('pb_select', { dark }) + errorClass,
|
75
|
+
const css = classnames(buildCss('pb_select', { dark }) + errorClass, globalProps(props))
|
76
76
|
const ariaProps = buildAriaProps(aria)
|
77
77
|
const dataProps = buildDataProps(data)
|
78
78
|
const optionsList = createOptions(options)
|
@@ -13,7 +13,7 @@ import {
|
|
13
13
|
noop,
|
14
14
|
} from '../utilities/props'
|
15
15
|
|
16
|
-
import {
|
16
|
+
import { globalProps } from '../utilities/globalProps.js'
|
17
17
|
|
18
18
|
type Props = {
|
19
19
|
aria: Object,
|
@@ -95,7 +95,7 @@ const SelectableCard = ({
|
|
95
95
|
value={value}
|
96
96
|
/>
|
97
97
|
<label
|
98
|
-
className={
|
98
|
+
className={globalProps(props)}
|
99
99
|
htmlFor={inputIdPresent}
|
100
100
|
>
|
101
101
|
{text || children}
|
@@ -5,7 +5,7 @@ import classnames from 'classnames'
|
|
5
5
|
|
6
6
|
import { buildCss } from '../utilities/props'
|
7
7
|
import { Body, Icon } from '../'
|
8
|
-
import {
|
8
|
+
import { globalProps } from '../utilities/globalProps.js'
|
9
9
|
|
10
10
|
const statusMap = {
|
11
11
|
increase: 'positive',
|
@@ -35,7 +35,7 @@ const StatChange = (props: StatChangeProps) => {
|
|
35
35
|
className={classnames(
|
36
36
|
className,
|
37
37
|
buildCss('pb_stat_change_kit', status),
|
38
|
-
|
38
|
+
globalProps(props)
|
39
39
|
)}
|
40
40
|
id={id}
|
41
41
|
>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { Title } from '../'
|
6
|
-
import {
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
type StatValueProps = {
|
9
9
|
className?: String,
|
@@ -44,7 +44,7 @@ const StatValue = (props: StatValueProps) => {
|
|
44
44
|
|
45
45
|
return (
|
46
46
|
<div
|
47
|
-
className={classnames('pb_stat_value_kit', className,
|
47
|
+
className={classnames('pb_stat_value_kit', className, globalProps(props))}
|
48
48
|
id={id}
|
49
49
|
>
|
50
50
|
<div className="pb_stat_value_wrapper">
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
import React, { type Node } from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
|
-
import {
|
5
|
+
import { globalProps } from '../utilities/globalProps.js'
|
6
6
|
|
7
7
|
type TableProps = {
|
8
8
|
children: Array<Node> | Node,
|
@@ -43,7 +43,7 @@ const Table = (props: TableProps) => {
|
|
43
43
|
'single-line': singleLine,
|
44
44
|
'no-hover': disableHover,
|
45
45
|
},
|
46
|
-
|
46
|
+
globalProps(props)
|
47
47
|
)}
|
48
48
|
>
|
49
49
|
{children}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import React from 'react'
|
3
3
|
import classnames from 'classnames'
|
4
4
|
import { buildCss } from '../utilities/props'
|
5
|
-
import {
|
5
|
+
import { globalProps } from '../utilities/globalProps.js'
|
6
6
|
|
7
7
|
type TableRowPropTypes = {
|
8
8
|
children: Array<React.ReactNode> | React.ReactNode,
|
@@ -17,7 +17,7 @@ const TableRow = (props: TableRowPropTypes) => {
|
|
17
17
|
const tableRowCss = buildCss('pb_table_row_kit', sideHighlightClass)
|
18
18
|
|
19
19
|
return (
|
20
|
-
<tr className={classnames(tableRowCss, className,
|
20
|
+
<tr className={classnames(tableRowCss, className, globalProps(props))}>
|
21
21
|
{children}
|
22
22
|
</tr>
|
23
23
|
)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import React from 'react'
|
3
3
|
import classnames from 'classnames'
|
4
4
|
import { Body, Caption } from '../'
|
5
|
-
import {
|
5
|
+
import { globalProps } from '../utilities/globalProps.js'
|
6
6
|
|
7
7
|
import {
|
8
8
|
buildAriaProps,
|
@@ -60,7 +60,7 @@ const TextInput = ({
|
|
60
60
|
dark={dark}
|
61
61
|
text={label}
|
62
62
|
/>
|
63
|
-
<div className={classnames('text_input_wrapper',
|
63
|
+
<div className={classnames('text_input_wrapper', globalProps(props))}>
|
64
64
|
<If condition={children}>
|
65
65
|
{children}
|
66
66
|
<Else />
|
@@ -4,7 +4,7 @@ import React from 'react'
|
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { Body, Caption } from '../'
|
6
6
|
import type { InputCallback } from '../types.js'
|
7
|
-
import {
|
7
|
+
import { globalProps } from '../utilities/globalProps.js'
|
8
8
|
|
9
9
|
type TextareaProps = {
|
10
10
|
className?: String,
|
@@ -43,7 +43,7 @@ const Textarea = ({
|
|
43
43
|
const resizeClass = ` resize_${resize}`
|
44
44
|
|
45
45
|
return (
|
46
|
-
<div className={classnames(textareaClass, className, errorClass, resizeClass,
|
46
|
+
<div className={classnames(textareaClass, className, errorClass, resizeClass, globalProps(props))}>
|
47
47
|
<Caption
|
48
48
|
dark={dark}
|
49
49
|
text={label}
|
@@ -4,7 +4,7 @@ import React from 'react'
|
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { Body, Caption, Icon } from '../'
|
6
6
|
import DateTime from '../pb_kit/dateTime.js'
|
7
|
-
import {
|
7
|
+
import { globalProps } from '../utilities/globalProps.js'
|
8
8
|
|
9
9
|
type TimeRangeInlineProps = {
|
10
10
|
className?: String,
|
@@ -78,7 +78,7 @@ const TimeRangeInline = (props: TimeRangeInlineProps) => {
|
|
78
78
|
|
79
79
|
return (
|
80
80
|
<div
|
81
|
-
className={classnames('pb_time_range_inline_kit_' + alignment, className,
|
81
|
+
className={classnames('pb_time_range_inline_kit_' + alignment, className, globalProps(props))}
|
82
82
|
>
|
83
83
|
<div className="pb_time_range_inline_wrapper">
|
84
84
|
<If condition={size == 'xs'}>
|
@@ -6,7 +6,7 @@ import classnames from 'classnames'
|
|
6
6
|
import DateTime from '../pb_kit/dateTime.js'
|
7
7
|
import { buildCss } from '../utilities/props'
|
8
8
|
import { Body, Caption } from '../'
|
9
|
-
import {
|
9
|
+
import { globalProps } from '../utilities/globalProps.js'
|
10
10
|
|
11
11
|
const Components = {
|
12
12
|
body: Body,
|
@@ -30,7 +30,7 @@ const TimeStacked = (props: TimeStackedProps) => {
|
|
30
30
|
buildCss('pb_time_stacked_kit', {
|
31
31
|
dark: dark,
|
32
32
|
}),
|
33
|
-
|
33
|
+
globalProps(props)
|
34
34
|
)
|
35
35
|
|
36
36
|
const tagClasses = classnames(buildCss('pb_time_stacked_kit', tag))
|
@@ -7,7 +7,7 @@ import { Caption } from '../'
|
|
7
7
|
|
8
8
|
import { buildCss, buildDataProps } from '../utilities/props'
|
9
9
|
|
10
|
-
import {
|
10
|
+
import { globalProps } from '../utilities/globalProps.js'
|
11
11
|
|
12
12
|
type TimestampProps = {
|
13
13
|
id?: String,
|
@@ -24,7 +24,7 @@ const Timestamp = (props: TimestampProps) => {
|
|
24
24
|
return (
|
25
25
|
<div
|
26
26
|
{...dataProps}
|
27
|
-
className={classnames(className, pbCss,
|
27
|
+
className={classnames(className, pbCss, globalProps(props))}
|
28
28
|
id={id}
|
29
29
|
>
|
30
30
|
<Caption
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
6
|
-
import {
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
type TitleProps = {
|
9
9
|
aria?: object,
|
@@ -35,7 +35,7 @@ const Title = (props: TitleProps) => {
|
|
35
35
|
const themeStyle = dark === true ? 'dark' : ''
|
36
36
|
const ariaProps = buildAriaProps(aria)
|
37
37
|
const dataProps = buildDataProps(data)
|
38
|
-
const classes = classnames(buildCss('pb_title_kit', size, themeStyle, variant), className,
|
38
|
+
const classes = classnames(buildCss('pb_title_kit', size, themeStyle, variant), className, globalProps(props))
|
39
39
|
const Tag = `${tag}`
|
40
40
|
|
41
41
|
return (
|
@@ -6,7 +6,7 @@ import classnames from 'classnames'
|
|
6
6
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
7
7
|
|
8
8
|
import { Body, Title } from '../'
|
9
|
-
import {
|
9
|
+
import { globalProps } from '../utilities/globalProps.js'
|
10
10
|
|
11
11
|
type TitleCountProps = {
|
12
12
|
align: "center" | "left" | "right",
|
@@ -32,7 +32,7 @@ const TitleCount = (props: TitleCountProps) => {
|
|
32
32
|
const ariaProps = buildAriaProps(aria)
|
33
33
|
const dataProps = buildDataProps(data)
|
34
34
|
|
35
|
-
const css = classnames(buildCss('pb_title_count_kit', align, size), className,
|
35
|
+
const css = classnames(buildCss('pb_title_count_kit', align, size), className, globalProps(props))
|
36
36
|
|
37
37
|
const formatCount = count.toLocaleString()
|
38
38
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
|
-
import {
|
5
|
+
import { globalProps } from '../utilities/globalProps.js'
|
6
6
|
|
7
7
|
import { Body, Title } from '../'
|
8
8
|
|
@@ -25,7 +25,7 @@ const TitleDetail = (props: TitleDetailProps) => {
|
|
25
25
|
return (
|
26
26
|
<div
|
27
27
|
{...dataProps}
|
28
|
-
className={classnames(className, pbCss,
|
28
|
+
className={classnames(className, pbCss, globalProps(props))}
|
29
29
|
id={id}
|
30
30
|
>
|
31
31
|
<Title
|
@@ -11,7 +11,7 @@ import {
|
|
11
11
|
noop,
|
12
12
|
} from '../utilities/props'
|
13
13
|
|
14
|
-
import {
|
14
|
+
import { globalProps } from '../utilities/globalProps.js'
|
15
15
|
|
16
16
|
type Props = {
|
17
17
|
aria: object,
|
@@ -51,7 +51,7 @@ const Toggle = ({
|
|
51
51
|
<div
|
52
52
|
{...ariaProps}
|
53
53
|
{...dataProps}
|
54
|
-
className={classnames(css,
|
54
|
+
className={classnames(css, globalProps(props))}
|
55
55
|
>
|
56
56
|
<label className="pb_toggle_wrapper">
|
57
57
|
<input
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { Avatar, Body, Title } from '../'
|
6
|
-
import {
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
type UserProps = {
|
9
9
|
className?: String,
|
@@ -30,7 +30,7 @@ const User = (props: UserProps) => {
|
|
30
30
|
avatarUrl,
|
31
31
|
} = props
|
32
32
|
return (
|
33
|
-
<div className={classnames(`pb_user_kit_${align}_${orientation}_${size}`,
|
33
|
+
<div className={classnames(`pb_user_kit_${align}_${orientation}_${size}`, globalProps(props))}>
|
34
34
|
<If condition={avatar || avatarUrl}>
|
35
35
|
<Avatar
|
36
36
|
imageUrl={avatarUrl}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/* @flow */
|
2
2
|
import React from 'react'
|
3
3
|
import classnames from 'classnames'
|
4
|
-
import {
|
4
|
+
import { globalProps } from '../utilities/globalProps.js'
|
5
5
|
|
6
6
|
type UserBadgeProps = {
|
7
7
|
className?: String,
|
@@ -15,7 +15,7 @@ const UserBadge = (props: UserBadgeProps) => {
|
|
15
15
|
const image = require(`./badges/_${badge}.svg`)
|
16
16
|
|
17
17
|
return (
|
18
|
-
<div className={classnames(`pb_user_badge_kit_${size}`,
|
18
|
+
<div className={classnames(`pb_user_badge_kit_${size}`, globalProps(props))}>
|
19
19
|
<div className="pb_user_badge_wrapper">
|
20
20
|
<img src={image} />
|
21
21
|
</div>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
|
-
import {
|
5
|
+
import { globalProps } from '../utilities/globalProps.js'
|
6
6
|
import { buildCss } from '../utilities/props'
|
7
7
|
|
8
8
|
import { Caption, Title } from '../'
|
@@ -52,7 +52,7 @@ const WeekdayStacked = (props: WeekdayStackedProps) => {
|
|
52
52
|
className={classnames(
|
53
53
|
buildCss('pb_weekday_stacked_kit', align),
|
54
54
|
className,
|
55
|
-
|
55
|
+
globalProps(props)
|
56
56
|
)}
|
57
57
|
>
|
58
58
|
<Caption dark={dark}>{getDayOfWeek(date, compact)}</Caption>
|
@@ -4,6 +4,8 @@ import { highchartsTheme } from '../pb_dashboard/pbChartsLightTheme.js'
|
|
4
4
|
import colors from '../tokens/_colors.scss'
|
5
5
|
|
6
6
|
require('highcharts/modules/variable-pie')(Highcharts)
|
7
|
+
import highchartsMore from 'highcharts/highcharts-more.js'
|
8
|
+
import solidGauge from 'highcharts/modules/solid-gauge.js'
|
7
9
|
|
8
10
|
// Map Data Color String Props to our SCSS Variables
|
9
11
|
const mapColors = (array) => {
|
@@ -67,11 +69,83 @@ class pbChart {
|
|
67
69
|
|
68
70
|
if (this.options.type == 'variablepie' || this.options.type == 'pie'){
|
69
71
|
this.setupPieChart(options)
|
72
|
+
} else if (this.options.type == 'gauge') {
|
73
|
+
this.setupGauge()
|
70
74
|
} else {
|
71
75
|
this.setupChart()
|
72
76
|
}
|
73
77
|
}
|
74
78
|
|
79
|
+
setupGauge() {
|
80
|
+
highchartsMore(Highcharts)
|
81
|
+
solidGauge(Highcharts)
|
82
|
+
Highcharts.setOptions(highchartsTheme)
|
83
|
+
|
84
|
+
Highcharts.chart(this.defaults.id, {
|
85
|
+
chart: {
|
86
|
+
type: this.defaults.style,
|
87
|
+
height: this.defaults.height,
|
88
|
+
},
|
89
|
+
title: {
|
90
|
+
text: this.defaults.title,
|
91
|
+
},
|
92
|
+
yAxis: {
|
93
|
+
min: this.defaults.min,
|
94
|
+
max: this.defaults.max,
|
95
|
+
lineWidth: 0,
|
96
|
+
tickWidth: 0,
|
97
|
+
minorTickInterval: null,
|
98
|
+
tickAmount: 2,
|
99
|
+
tickPositions: [this.defaults.min, this.defaults.max],
|
100
|
+
labels: {
|
101
|
+
y: 26,
|
102
|
+
enabled: this.defaults.showLabels,
|
103
|
+
},
|
104
|
+
},
|
105
|
+
credits: false,
|
106
|
+
series: [
|
107
|
+
{
|
108
|
+
data: this.defaults.chartData,
|
109
|
+
},
|
110
|
+
],
|
111
|
+
pane: {
|
112
|
+
center: ['50%', '50%'],
|
113
|
+
size: '90%',
|
114
|
+
startAngle: this.defaults.circumference[0],
|
115
|
+
endAngle: this.defaults.circumference[1],
|
116
|
+
background: {
|
117
|
+
borderWidth: 20,
|
118
|
+
innerRadius: '90%',
|
119
|
+
outerRadius: '90%',
|
120
|
+
shape: 'arc',
|
121
|
+
className: 'gauge-pane',
|
122
|
+
},
|
123
|
+
},
|
124
|
+
tooltip: {
|
125
|
+
headerFormat: '',
|
126
|
+
pointFormat: this.defaults.tooltipHtml,
|
127
|
+
followPointer: true,
|
128
|
+
},
|
129
|
+
plotOptions: {
|
130
|
+
series: {
|
131
|
+
animation: !this.defaults.disableAnimation,
|
132
|
+
},
|
133
|
+
solidgauge: {
|
134
|
+
dataLabels: {
|
135
|
+
format: `<span class="prefix">${this.defaults.prefix}</span>` +
|
136
|
+
'<span class="fix">{y:,f}</span>' +
|
137
|
+
`<span class="suffix">${this.defaults.suffix}</span>`,
|
138
|
+
},
|
139
|
+
},
|
140
|
+
},
|
141
|
+
})
|
142
|
+
document.querySelectorAll('.gauge-pane').forEach((pane) => pane.setAttribute('stroke-linejoin', 'round'))
|
143
|
+
if (document.querySelector('.prefix')) {
|
144
|
+
document.querySelectorAll('.prefix').forEach((prefix) => prefix.setAttribute('y', '28'))
|
145
|
+
document.querySelectorAll('.fix').forEach((fix) => fix.setAttribute('y', '38'))
|
146
|
+
}
|
147
|
+
}
|
148
|
+
|
75
149
|
setupPieChart(options) {
|
76
150
|
Highcharts.setOptions(highchartsTheme)
|
77
151
|
Highcharts.chart(this.defaults.id, {
|