playbook_ui 6.0.1.pre.alpha6 → 6.0.1
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 +1 -2
- data/app/pb_kits/playbook/data/menu.yml +2 -3
- data/app/pb_kits/playbook/index.js +0 -1
- data/app/pb_kits/playbook/packs/examples.js +0 -2
- data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +2 -2
- data/app/pb_kits/playbook/pb_badge/_badge.jsx +5 -2
- data/app/pb_kits/playbook/pb_badge/_badge.scss +1 -1
- data/app/pb_kits/playbook/pb_badge/badge.rb +6 -1
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +2 -2
- data/app/pb_kits/playbook/pb_body/_body.jsx +6 -3
- data/app/pb_kits/playbook/pb_body/_body.scss +0 -6
- data/app/pb_kits/playbook/pb_body/body.rb +8 -2
- data/app/pb_kits/playbook/pb_button/_button.jsx +5 -2
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -1
- data/app/pb_kits/playbook/pb_button/button.rb +7 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +0 -2
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +2 -2
- data/app/pb_kits/playbook/pb_card/_card.jsx +14 -17
- data/app/pb_kits/playbook/pb_card/_card.scss +1 -4
- data/app/pb_kits/playbook/pb_card/card.rb +9 -2
- 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 +8 -4
- 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 +2 -0
- 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 +0 -26
- 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 +2 -6
- 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 +0 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +0 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +1 -3
- data/app/pb_kits/playbook/pb_form/docs/_form_simple_form_validate.html.erb +1 -3
- data/app/pb_kits/playbook/pb_form/form_builder.rb +0 -2
- data/app/pb_kits/playbook/pb_form/form_builder/form_field_builder.rb +0 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +2 -2
- 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_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 +0 -74
- data/app/pb_kits/playbook/props.rb +0 -6
- data/app/pb_kits/playbook/utilities/props.js +0 -1
- data/app/pb_kits/playbook/utilities/{globalProps.js → spacing.js} +1 -14
- data/lib/generators/kit/templates/kit_jsx.erb.tt +2 -2
- data/lib/playbook/version.rb +1 -1
- metadata +6 -34
- data/app/pb_kits/playbook/pb_form/form_builder/checkbox_field.rb +0 -26
- data/app/pb_kits/playbook/pb_gauge/_gauge.html.erb +0 -12
- data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +0 -110
- data/app/pb_kits/playbook/pb_gauge/_gauge.scss +0 -11
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb +0 -11
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +0 -17
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.html.erb +0 -12
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +0 -18
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb +0 -14
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +0 -20
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb +0 -15
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +0 -23
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +0 -40
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb +0 -15
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +0 -21
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb +0 -26
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +0 -37
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb +0 -14
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +0 -20
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb +0 -29
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +0 -29
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +0 -24
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +0 -9
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +0 -57
- data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +0 -111
@@ -7,7 +7,7 @@ import { Caption } from '../'
|
|
7
7
|
|
8
8
|
import { buildCss, buildDataProps } from '../utilities/props'
|
9
9
|
|
10
|
-
import {
|
10
|
+
import { spacing } from '../utilities/spacing.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, spacing(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 { spacing } from '../utilities/spacing.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, spacing(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 { spacing } from '../utilities/spacing.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, spacing(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 { spacing } from '../utilities/spacing.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, spacing(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 { spacing } from '../utilities/spacing.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, spacing(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 { spacing } from '../utilities/spacing.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}`, spacing(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 { spacing } from '../utilities/spacing.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}`, spacing(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 { spacing } from '../utilities/spacing.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
|
+
spacing(props)
|
56
56
|
)}
|
57
57
|
>
|
58
58
|
<Caption dark={dark}>{getDayOfWeek(date, compact)}</Caption>
|
@@ -4,8 +4,6 @@ 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'
|
9
7
|
|
10
8
|
// Map Data Color String Props to our SCSS Variables
|
11
9
|
const mapColors = (array) => {
|
@@ -69,83 +67,11 @@ class pbChart {
|
|
69
67
|
|
70
68
|
if (this.options.type == 'variablepie' || this.options.type == 'pie'){
|
71
69
|
this.setupPieChart(options)
|
72
|
-
} else if (this.options.type == 'gauge') {
|
73
|
-
this.setupGauge()
|
74
70
|
} else {
|
75
71
|
this.setupChart()
|
76
72
|
}
|
77
73
|
}
|
78
74
|
|
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
|
-
|
149
75
|
setupPieChart(options) {
|
150
76
|
Highcharts.setOptions(highchartsTheme)
|
151
77
|
Highcharts.chart(this.defaults.id, {
|
@@ -43,16 +43,11 @@ module Playbook
|
|
43
43
|
end.compact.join(" ")
|
44
44
|
end
|
45
45
|
|
46
|
-
def dark_props
|
47
|
-
dark ? "dark" : nil
|
48
|
-
end
|
49
|
-
|
50
46
|
def generate_classname(*name_parts, separator: "_")
|
51
47
|
[
|
52
48
|
name_parts.compact.join(separator),
|
53
49
|
prop(:classname),
|
54
50
|
spacing_props,
|
55
|
-
dark_props
|
56
51
|
].compact.join(" ")
|
57
52
|
end
|
58
53
|
|
@@ -86,7 +81,6 @@ module Playbook
|
|
86
81
|
prop :padding_top
|
87
82
|
prop :padding_x
|
88
83
|
prop :padding_y
|
89
|
-
prop :dark, type: Playbook::Props::Boolean, default: false
|
90
84
|
end
|
91
85
|
|
92
86
|
def spacing_options
|
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
const spacingProps = ({
|
1
|
+
export const spacing = ({
|
3
2
|
marginRight,
|
4
3
|
marginLeft,
|
5
4
|
marginTop,
|
@@ -32,15 +31,3 @@ const spacingProps = ({
|
|
32
31
|
css += padding ? `p_${padding} ` : ''
|
33
32
|
return css
|
34
33
|
}
|
35
|
-
|
36
|
-
const darkProps = ({ dark }) => {
|
37
|
-
let css = ''
|
38
|
-
css += dark ? 'dark' : ''
|
39
|
-
return css
|
40
|
-
}
|
41
|
-
|
42
|
-
// All Exported as a single function
|
43
|
-
export const globalProps = (props, defaultProps = {}) => {
|
44
|
-
const allProps = { ...props, ...defaultProps }
|
45
|
-
return spacingProps(allProps) + darkProps(allProps)
|
46
|
-
}
|
@@ -38,7 +38,7 @@ props_names = @kit_props.keys.map do |key|
|
|
38
38
|
import React from 'react'
|
39
39
|
import classnames from 'classnames'
|
40
40
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
41
|
-
import {
|
41
|
+
import { spacing } from '../utilities/spacing.js'
|
42
42
|
|
43
43
|
type <%= type_name %> = {
|
44
44
|
<%= break_lines.call(props_types) %>
|
@@ -51,7 +51,7 @@ const <%= @kit_name_pascal %> = (props: <%= type_name %>) => {
|
|
51
51
|
|
52
52
|
const ariaProps = buildAriaProps(aria)
|
53
53
|
const dataProps = buildDataProps(data)
|
54
|
-
const classes = classnames(buildCss('pb_<%= @kit_name_underscore %>'), className,
|
54
|
+
const classes = classnames(buildCss('pb_<%= @kit_name_underscore %>'), className, spacing(props))
|
55
55
|
|
56
56
|
return (
|
57
57
|
<div
|
data/lib/playbook/version.rb
CHANGED
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: 6.0.1
|
4
|
+
version: 6.0.1
|
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: 2020-
|
12
|
+
date: 2020-07-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -829,7 +829,6 @@ files:
|
|
829
829
|
- app/pb_kits/playbook/pb_form/form/simple_form_form.rb
|
830
830
|
- app/pb_kits/playbook/pb_form/form_builder.rb
|
831
831
|
- app/pb_kits/playbook/pb_form/form_builder/action_area.rb
|
832
|
-
- app/pb_kits/playbook/pb_form/form_builder/checkbox_field.rb
|
833
832
|
- app/pb_kits/playbook/pb_form/form_builder/collection_select_field.rb
|
834
833
|
- app/pb_kits/playbook/pb_form/form_builder/form_field_builder.rb
|
835
834
|
- app/pb_kits/playbook/pb_form/form_builder/form_with_form_builder.rb
|
@@ -847,31 +846,6 @@ files:
|
|
847
846
|
- app/pb_kits/playbook/pb_form_pill/docs/example.yml
|
848
847
|
- app/pb_kits/playbook/pb_form_pill/docs/index.js
|
849
848
|
- app/pb_kits/playbook/pb_form_pill/form_pill.rb
|
850
|
-
- app/pb_kits/playbook/pb_gauge/_gauge.html.erb
|
851
|
-
- app/pb_kits/playbook/pb_gauge/_gauge.jsx
|
852
|
-
- app/pb_kits/playbook/pb_gauge/_gauge.scss
|
853
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb
|
854
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx
|
855
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.html.erb
|
856
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx
|
857
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb
|
858
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx
|
859
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb
|
860
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx
|
861
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx
|
862
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb
|
863
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx
|
864
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.md
|
865
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb
|
866
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx
|
867
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.md
|
868
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb
|
869
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx
|
870
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb
|
871
|
-
- app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx
|
872
|
-
- app/pb_kits/playbook/pb_gauge/docs/example.yml
|
873
|
-
- app/pb_kits/playbook/pb_gauge/docs/index.js
|
874
|
-
- app/pb_kits/playbook/pb_gauge/gauge.rb
|
875
849
|
- app/pb_kits/playbook/pb_hashtag/_hashtag.html.erb
|
876
850
|
- app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
|
877
851
|
- app/pb_kits/playbook/pb_hashtag/_hashtag.scss
|
@@ -1123,7 +1097,6 @@ files:
|
|
1123
1097
|
- app/pb_kits/playbook/pb_loading_inline/docs/example.yml
|
1124
1098
|
- app/pb_kits/playbook/pb_loading_inline/docs/index.js
|
1125
1099
|
- app/pb_kits/playbook/pb_loading_inline/loading_inline.rb
|
1126
|
-
- app/pb_kits/playbook/pb_logistic/_logistic.jsx
|
1127
1100
|
- app/pb_kits/playbook/pb_message/_message.html.erb
|
1128
1101
|
- app/pb_kits/playbook/pb_message/_message.jsx
|
1129
1102
|
- app/pb_kits/playbook/pb_message/_message.scss
|
@@ -1760,8 +1733,8 @@ files:
|
|
1760
1733
|
- app/pb_kits/playbook/utilities/_background_colors.scss
|
1761
1734
|
- app/pb_kits/playbook/utilities/_colors.scss
|
1762
1735
|
- app/pb_kits/playbook/utilities/_spacing.scss
|
1763
|
-
- app/pb_kits/playbook/utilities/globalProps.js
|
1764
1736
|
- app/pb_kits/playbook/utilities/props.js
|
1737
|
+
- app/pb_kits/playbook/utilities/spacing.js
|
1765
1738
|
- app/pb_kits/playbook/utilities/text.js
|
1766
1739
|
- app/pb_kits/playbook/vendor.js
|
1767
1740
|
- app/views/layouts/playbook/_mobile_hamburger.html.erb
|
@@ -1839,12 +1812,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1839
1812
|
version: '0'
|
1840
1813
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1841
1814
|
requirements:
|
1842
|
-
- - "
|
1815
|
+
- - ">="
|
1843
1816
|
- !ruby/object:Gem::Version
|
1844
|
-
version:
|
1817
|
+
version: '0'
|
1845
1818
|
requirements: []
|
1846
|
-
|
1847
|
-
rubygems_version: 2.7.3
|
1819
|
+
rubygems_version: 3.1.4
|
1848
1820
|
signing_key:
|
1849
1821
|
specification_version: 4
|
1850
1822
|
summary: Playbook Design System
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbForm
|
5
|
-
module FormBuilder
|
6
|
-
module CheckboxField
|
7
|
-
def check_box(name, data: {}, props: {})
|
8
|
-
value = props[:value] ||= 1
|
9
|
-
input = super(name, { required: props[:required], data: data }, value)
|
10
|
-
label_text = name.to_s.gsub("_", " ")
|
11
|
-
|
12
|
-
if props[:label]
|
13
|
-
@template.pb_rails("caption", props: { text: label_text, margin_bottom: "xs" }) +
|
14
|
-
@template.pb_rails("checkbox", props: props) do
|
15
|
-
input
|
16
|
-
end
|
17
|
-
else
|
18
|
-
@template.pb_rails("checkbox", props: props) do
|
19
|
-
input
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<%= content_tag(:div, "",
|
2
|
-
id: object.id,
|
3
|
-
data: object.data,
|
4
|
-
class: object.classname) %>
|
5
|
-
<% content_for :pb_js do %>
|
6
|
-
<%= javascript_tag do %>
|
7
|
-
window.addEventListener('DOMContentLoaded', function() {
|
8
|
-
new pbChart('.selector', <%= object.chart_options %>)
|
9
|
-
})
|
10
|
-
<% end %>
|
11
|
-
<% end %>
|
12
|
-
|