playbook_ui 6.7.0 → 6.8.0
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/index.js +1 -0
- data/app/pb_kits/playbook/packs/examples.js +2 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +5 -1
- 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_picker/_date_picker.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +4 -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 +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +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_textarea/_textarea.jsx +1 -1
- data/app/pb_kits/playbook/pb_time/_time.jsx +2 -2
- data/app/pb_kits/playbook/pb_time/docs/_time_timezone.html.erb +2 -1
- 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_user_badge/_user_badge.jsx +5 -2
- data/app/pb_kits/playbook/plugins/pb_chart.js +1 -1
- data/lib/generators/kit/templates/kit_jsx.erb.tt +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +19 -5
- 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
@@ -18,7 +18,7 @@ const FlexItem = (props: FlexItemPropTypes) => {
|
|
18
18
|
|
19
19
|
return (
|
20
20
|
<div
|
21
|
-
className={classnames(buildCss('pb_flex_item_kit', growClass),
|
21
|
+
className={classnames(buildCss('pb_flex_item_kit', growClass), globalProps(props), className)}
|
22
22
|
style={fixedStyle}
|
23
23
|
>
|
24
24
|
{children}
|
@@ -24,7 +24,12 @@
|
|
24
24
|
<%= form.text_area :example_text_area, props: { label: true } %>
|
25
25
|
<%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true } %>
|
26
26
|
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
|
27
|
-
<%= form.check_box :example_checkbox,
|
27
|
+
<%= form.check_box :example_checkbox,
|
28
|
+
data: { field1: "value1", field2: "value2" },
|
29
|
+
props: { text: "Example Checkbox", label: true },
|
30
|
+
id: "checkbox-id",
|
31
|
+
name: "checkbox-name",
|
32
|
+
class: "checkbox-class" %>
|
28
33
|
<%= form.date_picker :example_date_picker1, props: { default_date: "blank" } %>
|
29
34
|
|
30
35
|
<%= form.actions do |action| %>
|
@@ -18,8 +18,9 @@ type FormPillProps = {
|
|
18
18
|
const FormPill = (props: FormPillProps) => {
|
19
19
|
const { className, text, name, onClick = () => {}, avatarUrl } = props
|
20
20
|
const css = classnames(
|
21
|
-
|
22
|
-
globalProps(props)
|
21
|
+
`pb_form_pill_kit_${'primary'}`,
|
22
|
+
globalProps(props),
|
23
|
+
className
|
23
24
|
)
|
24
25
|
return (
|
25
26
|
<div className={css}>
|
@@ -27,7 +27,7 @@ const Highlight = (props: HighlightProps) => {
|
|
27
27
|
<Highlighter
|
28
28
|
autoEscape
|
29
29
|
data={data}
|
30
|
-
highlightClassName={classnames(
|
30
|
+
highlightClassName={classnames(globalProps(props), className)}
|
31
31
|
highlightTag="span"
|
32
32
|
id={id}
|
33
33
|
searchWords={highlightedText}
|
@@ -40,12 +40,12 @@ const HomeAddressStreet = (props: HomeAddressStreetProps) => {
|
|
40
40
|
|
41
41
|
const classes = (className, dark) =>
|
42
42
|
classnames(
|
43
|
-
className,
|
44
43
|
{
|
45
44
|
'pb_home_address_street': !dark,
|
46
45
|
'pb_home_address_street_dark': dark,
|
47
46
|
},
|
48
|
-
globalProps(props)
|
47
|
+
globalProps(props),
|
48
|
+
className
|
49
49
|
)
|
50
50
|
return (
|
51
51
|
<div className={classes(className, dark)}>
|
@@ -56,7 +56,6 @@ const Icon = (props: IconProps) => {
|
|
56
56
|
spin = false,
|
57
57
|
} = props
|
58
58
|
const classes = classnames(
|
59
|
-
className,
|
60
59
|
flipMap[flip],
|
61
60
|
'pb_icon_kit',
|
62
61
|
'far',
|
@@ -72,7 +71,8 @@ const Icon = (props: IconProps) => {
|
|
72
71
|
[`fa-pull-${pull}`]: pull,
|
73
72
|
[`fa-rotate-${rotation}`]: rotation,
|
74
73
|
},
|
75
|
-
globalProps(props)
|
74
|
+
globalProps(props),
|
75
|
+
className
|
76
76
|
)
|
77
77
|
|
78
78
|
return (
|
@@ -32,7 +32,11 @@ const IconValue = (props: IconValueProps) => {
|
|
32
32
|
} = props
|
33
33
|
const ariaProps = buildAriaProps(aria)
|
34
34
|
const dataProps = buildDataProps(data)
|
35
|
-
const classes = classnames(
|
35
|
+
const classes = classnames(
|
36
|
+
buildCss('pb_icon_value_kit', align),
|
37
|
+
globalProps(props),
|
38
|
+
className
|
39
|
+
)
|
36
40
|
|
37
41
|
return (
|
38
42
|
<div
|
@@ -25,7 +25,11 @@ const Image = (props: ImageProps) => {
|
|
25
25
|
} = props
|
26
26
|
|
27
27
|
const ariaProps = buildAriaProps(aria)
|
28
|
-
const classes = classnames(
|
28
|
+
const classes = classnames(
|
29
|
+
buildCss('pb_image lazyload blur_up'),
|
30
|
+
globalProps(props),
|
31
|
+
className
|
32
|
+
)
|
29
33
|
const dataProps = buildDataProps(data)
|
30
34
|
|
31
35
|
return (
|
@@ -30,7 +30,11 @@ const LabelPill = (props: LabelPillProps) => {
|
|
30
30
|
} = props
|
31
31
|
const ariaProps = buildAriaProps(aria)
|
32
32
|
const dataProps = buildDataProps(data)
|
33
|
-
const css = classnames(
|
33
|
+
const css = classnames(
|
34
|
+
'pb_label_pill_kit',
|
35
|
+
globalProps(props),
|
36
|
+
className
|
37
|
+
)
|
34
38
|
|
35
39
|
return (
|
36
40
|
<div
|
@@ -46,7 +46,7 @@ type LayoutFooterProps = {
|
|
46
46
|
const Side = (props: LayoutSideProps) => {
|
47
47
|
const { children, className } = props
|
48
48
|
return (
|
49
|
-
<div className={classnames('layout_sidebar',
|
49
|
+
<div className={classnames('layout_sidebar', globalProps(props), className)}>
|
50
50
|
{children}
|
51
51
|
</div>
|
52
52
|
)
|
@@ -56,7 +56,7 @@ const Side = (props: LayoutSideProps) => {
|
|
56
56
|
const Body = (props: LayoutBodyProps) => {
|
57
57
|
const { children, className } = props
|
58
58
|
return (
|
59
|
-
<div className={classnames('layout_body',
|
59
|
+
<div className={classnames('layout_body', globalProps(props), className)}>
|
60
60
|
{children}
|
61
61
|
</div>
|
62
62
|
)
|
@@ -66,7 +66,7 @@ const Body = (props: LayoutBodyProps) => {
|
|
66
66
|
const Header = (props: LayoutHeaderProps) => {
|
67
67
|
const { children, className } = props
|
68
68
|
return (
|
69
|
-
<div className={classnames('layout_header',
|
69
|
+
<div className={classnames('layout_header', globalProps(props), className)}>
|
70
70
|
{children}
|
71
71
|
</div>
|
72
72
|
)
|
@@ -76,7 +76,7 @@ const Header = (props: LayoutHeaderProps) => {
|
|
76
76
|
const Footer = (props: LayoutFooterProps) => {
|
77
77
|
const { children, className } = props
|
78
78
|
return (
|
79
|
-
<div className={classnames('layout_footer',
|
79
|
+
<div className={classnames('layout_footer', globalProps(props), className)}>
|
80
80
|
{children}
|
81
81
|
</div>
|
82
82
|
)
|
@@ -27,8 +27,9 @@ const ListItem = (props: ListItemProps) => {
|
|
27
27
|
const ariaProps = buildAriaProps(aria)
|
28
28
|
const dataProps = buildDataProps(data)
|
29
29
|
const classes = classnames(
|
30
|
-
buildCss('pb_item_kit'),
|
31
|
-
globalProps(props)
|
30
|
+
buildCss('pb_item_kit'),
|
31
|
+
globalProps(props),
|
32
|
+
className
|
32
33
|
)
|
33
34
|
|
34
35
|
return (
|
@@ -40,7 +40,11 @@ const Logistic = (props: LogisticProps) => {
|
|
40
40
|
const ariaProps = buildAriaProps(aria)
|
41
41
|
const dataProps = buildDataProps(data)
|
42
42
|
const formattedDate = new DateTime({ value: date })
|
43
|
-
const classes = classnames(
|
43
|
+
const classes = classnames(
|
44
|
+
buildCss('pb_logistic_kit', { dark }),
|
45
|
+
globalProps(props),
|
46
|
+
className
|
47
|
+
)
|
44
48
|
|
45
49
|
return (
|
46
50
|
<div
|
@@ -39,7 +39,11 @@ const Message = (props: MessageProps) => {
|
|
39
39
|
? 'pb_message_kit_avatar'
|
40
40
|
: 'pb_message_kit'
|
41
41
|
|
42
|
-
const classes = classnames(
|
42
|
+
const classes = classnames(
|
43
|
+
buildCss(baseClassName),
|
44
|
+
globalProps(props),
|
45
|
+
className
|
46
|
+
)
|
43
47
|
|
44
48
|
return (
|
45
49
|
<div
|
@@ -36,8 +36,11 @@ const MultipleUsers = (props: MultipleUsersProps) => {
|
|
36
36
|
const reverseClass = reverse === true ? 'reverse' : ''
|
37
37
|
const ariaProps = buildAriaProps(aria)
|
38
38
|
const dataProps = buildDataProps(data)
|
39
|
-
const classes = classnames(
|
40
|
-
|
39
|
+
const classes = classnames(
|
40
|
+
buildCss('pb_multiple_users_kit', reverseClass),
|
41
|
+
globalProps(props),
|
42
|
+
className
|
43
|
+
)
|
41
44
|
|
42
45
|
return (
|
43
46
|
<div
|
@@ -32,7 +32,11 @@ const Person = (props: PersonProps) => {
|
|
32
32
|
|
33
33
|
const ariaProps = buildAriaProps(aria)
|
34
34
|
const dataProps = buildDataProps(data)
|
35
|
-
const classes = classnames(
|
35
|
+
const classes = classnames(
|
36
|
+
buildCss('pb_person_kit'),
|
37
|
+
globalProps(props),
|
38
|
+
className
|
39
|
+
)
|
36
40
|
|
37
41
|
return (
|
38
42
|
<div
|
@@ -43,7 +43,11 @@ const PersonContact = (props: PersonContactProps) => {
|
|
43
43
|
|
44
44
|
const ariaProps = buildAriaProps(aria)
|
45
45
|
const dataProps = buildDataProps(data)
|
46
|
-
const classes = classnames(
|
46
|
+
const classes = classnames(
|
47
|
+
buildCss('pb_person_contact_kit'),
|
48
|
+
globalProps(props),
|
49
|
+
className
|
50
|
+
)
|
47
51
|
|
48
52
|
const wrongContacts = () => (
|
49
53
|
contacts.filter((contactObject) => (
|
@@ -78,7 +78,11 @@ const Popover = (props: PbPopoverProps) => {
|
|
78
78
|
}
|
79
79
|
const ariaProps = buildAriaProps(aria)
|
80
80
|
const dataProps = buildDataProps(data)
|
81
|
-
const classes = classnames(
|
81
|
+
const classes = classnames(
|
82
|
+
buildCss('pb_popover_kit'),
|
83
|
+
globalProps(props),
|
84
|
+
className
|
85
|
+
)
|
82
86
|
|
83
87
|
return (
|
84
88
|
<Popper
|
@@ -41,14 +41,14 @@ const ProgressSimple = (props: ProgressSimpleProps) => {
|
|
41
41
|
}
|
42
42
|
|
43
43
|
const wrapperClass = classnames(
|
44
|
-
className,
|
45
44
|
buildCss('pb_progress_simple_wrapper', align, { dark: dark }),
|
46
|
-
globalProps(props)
|
45
|
+
globalProps(props),
|
46
|
+
className
|
47
47
|
)
|
48
48
|
|
49
49
|
const kitClass = classnames(
|
50
|
-
|
51
|
-
|
50
|
+
buildCss('pb_progress_simple_kit', { muted }, variantStyle, align),
|
51
|
+
className
|
52
52
|
)
|
53
53
|
|
54
54
|
return (
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<% if object.children %>
|
10
10
|
<%= capture(&object.children) %>
|
11
11
|
<% else %>
|
12
|
-
<%= radio_button_tag object.name, object.value, object.selected %>
|
12
|
+
<%= radio_button_tag object.name, object.value, object.selected, object.input_options %>
|
13
13
|
<% end %>
|
14
14
|
|
15
15
|
<span class="pb_radio_button"></span>
|
@@ -15,6 +15,8 @@ module Playbook
|
|
15
15
|
default: false
|
16
16
|
prop :error, type: Playbook::Props::Boolean,
|
17
17
|
default: false
|
18
|
+
prop :input_options, type: Playbook::Props::Hash,
|
19
|
+
default: {}
|
18
20
|
prop :name, type: Playbook::Props::String,
|
19
21
|
default: "radio_name"
|
20
22
|
prop :text, type: Playbook::Props::String,
|
@@ -26,10 +28,6 @@ module Playbook
|
|
26
28
|
generate_classname("pb_radio_kit") + error_class
|
27
29
|
end
|
28
30
|
|
29
|
-
def input
|
30
|
-
check_box_tag(name, value, checked)
|
31
|
-
end
|
32
|
-
|
33
31
|
def selected
|
34
32
|
"checked" if checked == true
|
35
33
|
end
|
@@ -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),
|
33
|
+
const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation, themeStyle), globalProps(props), className)
|
34
34
|
|
35
35
|
return (
|
36
36
|
|
@@ -21,11 +21,11 @@ const StatValue = (props: StatValueProps) => {
|
|
21
21
|
} = props
|
22
22
|
|
23
23
|
const displayValue = function(value) {
|
24
|
-
if (value) {
|
24
|
+
if (value || value === 0) {
|
25
25
|
return (
|
26
26
|
<Title
|
27
27
|
size={1}
|
28
|
-
text={value}
|
28
|
+
text={`${value}`}
|
29
29
|
/>
|
30
30
|
)
|
31
31
|
}
|
@@ -44,7 +44,7 @@ const StatValue = (props: StatValueProps) => {
|
|
44
44
|
|
45
45
|
return (
|
46
46
|
<div
|
47
|
-
className={classnames('pb_stat_value_kit',
|
47
|
+
className={classnames('pb_stat_value_kit', globalProps(props), className)}
|
48
48
|
id={id}
|
49
49
|
>
|
50
50
|
<div className="pb_stat_value_wrapper">
|