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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24e44a8fd04883d36ed1656d1cfa4791e15abfaacbcd7b2a7788e4f8ee648507
|
4
|
+
data.tar.gz: d27894c4b909d292b8b180feedda3d74d8e942eeb62013c0b8b1278aec8a5f19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2f35473ea28f15292080b7b60264b7c2cf0b3cb599808084f96afe15835d283c07715227b05b86cb8286ee1649256e3997b20b02f16f4231a0a0cafeaeea226
|
7
|
+
data.tar.gz: 63cb7236310ad3ff67e13e62f0ee20a2e8b720edef687ee9c2e814a9fb93b9377a39707bb588f8b8b5ee41a50796e0af751613a6ca9fc3efebcae8d5d6266e03
|
@@ -26,7 +26,6 @@
|
|
26
26
|
@import 'pb_form/form';
|
27
27
|
@import 'pb_form_pill/form_pill';
|
28
28
|
@import 'pb_flex/flex';
|
29
|
-
@import 'pb_gauge/gauge';
|
30
29
|
@import 'pb_hashtag/hashtag';
|
31
30
|
@import 'pb_highlight/highlight';
|
32
31
|
@import 'pb_home_address_street/home_address_street';
|
@@ -79,4 +78,4 @@
|
|
79
78
|
@import 'pb_user_badge/user_badge';
|
80
79
|
@import 'pb_time_stacked/time_stacked';
|
81
80
|
@import 'pb_weekday_stacked/weekday_stacked';
|
82
|
-
@import './utilities/spacing';
|
81
|
+
@import './utilities/spacing';
|
@@ -25,7 +25,6 @@ export FixedConfirmationToast from './pb_fixed_confirmation_toast/_fixed_confirm
|
|
25
25
|
export Flex from './pb_flex/_flex.jsx'
|
26
26
|
export FlexItem from './pb_flex/_flex_item.jsx'
|
27
27
|
export FormPill from './pb_form_pill/_form_pill.jsx'
|
28
|
-
export Gauge from './pb_gauge/_gauge.jsx'
|
29
28
|
export Hashtag from './pb_hashtag/_hashtag.jsx'
|
30
29
|
export Highlight from './pb_highlight/_highlight.jsx'
|
31
30
|
export HomeAddressStreet from './pb_home_address_street/_home_address_street.jsx'
|
@@ -38,7 +38,6 @@ import * as Filter from 'pb_filter/docs'
|
|
38
38
|
import * as FixedConfirmationToast from 'pb_fixed_confirmation_toast/docs'
|
39
39
|
import * as Flex from 'pb_flex/docs'
|
40
40
|
import * as FormPill from 'pb_form_pill/docs'
|
41
|
-
import * as Gauge from 'pb_gauge/docs'
|
42
41
|
import * as Hashtag from 'pb_hashtag/docs'
|
43
42
|
import * as Highlight from 'pb_highlight/docs'
|
44
43
|
import * as HomeAddressStreet from 'pb_home_address_street/docs'
|
@@ -117,7 +116,6 @@ WebpackerReact.setup({
|
|
117
116
|
...FixedConfirmationToast,
|
118
117
|
...Flex,
|
119
118
|
...FormPill,
|
120
|
-
...Gauge,
|
121
119
|
...Hashtag,
|
122
120
|
...Highlight,
|
123
121
|
...HomeAddressStreet,
|
@@ -5,7 +5,7 @@ import classnames from 'classnames'
|
|
5
5
|
import { map } from 'lodash'
|
6
6
|
|
7
7
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
8
|
-
import {
|
8
|
+
import { spacing } from '../utilities/spacing.js'
|
9
9
|
|
10
10
|
import { Image } from '../'
|
11
11
|
|
@@ -29,7 +29,7 @@ const Avatar = (props: AvatarProps) => {
|
|
29
29
|
const { aria = {}, className, data = {}, name = null, id = id, imageUrl, size = 'md', status = null } = props
|
30
30
|
const dataProps = buildDataProps(data)
|
31
31
|
const ariaProps = buildAriaProps(aria)
|
32
|
-
const classes = classnames(buildCss('pb_avatar_kit', size), className,
|
32
|
+
const classes = classnames(buildCss('pb_avatar_kit', size), className, spacing(props))
|
33
33
|
|
34
34
|
const initials = name && firstTwoInitials(name)
|
35
35
|
dataProps['data-initials'] = initials
|
@@ -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 {
|
8
8
|
buildAriaProps,
|
@@ -13,6 +13,7 @@ import {
|
|
13
13
|
type BadgeProps = {
|
14
14
|
aria?: object,
|
15
15
|
className?: String,
|
16
|
+
dark?: Boolean,
|
16
17
|
data?: object,
|
17
18
|
id?: String,
|
18
19
|
rounded?: Boolean,
|
@@ -23,6 +24,7 @@ const Badge = (props: BadgeProps) => {
|
|
23
24
|
const {
|
24
25
|
aria = {},
|
25
26
|
className,
|
27
|
+
dark = false,
|
26
28
|
data = {},
|
27
29
|
id,
|
28
30
|
rounded = false,
|
@@ -35,8 +37,9 @@ const Badge = (props: BadgeProps) => {
|
|
35
37
|
className,
|
36
38
|
buildCss('pb_badge_kit', variant, {
|
37
39
|
rounded: rounded,
|
40
|
+
dark: dark,
|
38
41
|
}),
|
39
|
-
|
42
|
+
spacing(props)
|
40
43
|
)
|
41
44
|
|
42
45
|
return (
|
@@ -7,6 +7,7 @@ module Playbook
|
|
7
7
|
|
8
8
|
partial "pb_badge/badge"
|
9
9
|
|
10
|
+
prop :dark, type: Playbook::Props::Boolean, default: false
|
10
11
|
prop :rounded, type: Playbook::Props::Boolean, default: false
|
11
12
|
prop :text
|
12
13
|
prop :variant, type: Playbook::Props::Enum,
|
@@ -14,11 +15,15 @@ module Playbook
|
|
14
15
|
default: "neutral"
|
15
16
|
|
16
17
|
def classname
|
17
|
-
generate_classname("pb_badge_kit", variant, rounded_class)
|
18
|
+
generate_classname("pb_badge_kit", variant, rounded_class, dark_class)
|
18
19
|
end
|
19
20
|
|
20
21
|
private
|
21
22
|
|
23
|
+
def dark_class
|
24
|
+
dark ? "dark" : nil
|
25
|
+
end
|
26
|
+
|
22
27
|
def rounded_class
|
23
28
|
rounded ? "rounded" : nil
|
24
29
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { pbChart } from '../'
|
6
|
-
import {
|
6
|
+
import { spacing } from '../utilities/spacing.js'
|
7
7
|
|
8
8
|
type BarGraphProps = {
|
9
9
|
axisTitle: String,
|
@@ -75,7 +75,7 @@ export default class BarGraph extends React.Component<BarGraphProps> {
|
|
75
75
|
|
76
76
|
return (
|
77
77
|
<div
|
78
|
-
className={classnames(className,
|
78
|
+
className={classnames(className, spacing(this.props))}
|
79
79
|
id={id}
|
80
80
|
/>
|
81
81
|
)
|
@@ -4,7 +4,7 @@ import React from 'react'
|
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
6
6
|
import { Highlight } from '../'
|
7
|
-
import {
|
7
|
+
import { spacing } from '../utilities/spacing.js'
|
8
8
|
|
9
9
|
type BodyProps = {
|
10
10
|
aria?: object,
|
@@ -27,6 +27,7 @@ const Body = (props: BodyProps) => {
|
|
27
27
|
className,
|
28
28
|
children,
|
29
29
|
color = '',
|
30
|
+
dark = false,
|
30
31
|
data = {},
|
31
32
|
highlightedText = [],
|
32
33
|
highlighting = false,
|
@@ -39,8 +40,10 @@ const Body = (props: BodyProps) => {
|
|
39
40
|
const ariaProps = buildAriaProps(aria)
|
40
41
|
const dataProps = buildDataProps(data)
|
41
42
|
const classes = classnames(
|
42
|
-
buildCss('pb_body_kit', color, status
|
43
|
-
|
43
|
+
buildCss('pb_body_kit', color, status, {
|
44
|
+
dark: dark,
|
45
|
+
}),
|
46
|
+
spacing(props),
|
44
47
|
className
|
45
48
|
)
|
46
49
|
const Tag = `${tag}`
|
@@ -11,6 +11,8 @@ module Playbook
|
|
11
11
|
prop :color, type: Playbook::Props::Enum,
|
12
12
|
values: %w[default light lighter dark light_dark lighter_dark],
|
13
13
|
default: "default"
|
14
|
+
prop :dark, type: Playbook::Props::Boolean,
|
15
|
+
default: false
|
14
16
|
prop :status, type: Playbook::Props::Enum,
|
15
17
|
values: %w[neutral negative positive],
|
16
18
|
default: "neutral"
|
@@ -24,7 +26,7 @@ module Playbook
|
|
24
26
|
default: []
|
25
27
|
|
26
28
|
def classname
|
27
|
-
generate_classname("pb_body_kit", color_class, status_class)
|
29
|
+
generate_classname("pb_body_kit", color_class, dark_class, status_class)
|
28
30
|
end
|
29
31
|
|
30
32
|
def content
|
@@ -39,11 +41,15 @@ module Playbook
|
|
39
41
|
highlight_tags = pb_highlight_output.split("|")
|
40
42
|
highlight(text, highlighted_text, highlighter: "#{highlight_tags.first.html_safe} \\1 #{highlight_tags.last.html_safe}")
|
41
43
|
end
|
42
|
-
|
44
|
+
|
43
45
|
def color_class
|
44
46
|
color != "default" ? color : nil
|
45
47
|
end
|
46
48
|
|
49
|
+
def dark_class
|
50
|
+
dark ? "dark" : nil
|
51
|
+
end
|
52
|
+
|
47
53
|
def status_class
|
48
54
|
status != "neutral" ? status : nil
|
49
55
|
end
|
@@ -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 Icon from '../pb_icon/_icon.jsx'
|
8
8
|
|
@@ -13,6 +13,7 @@ type ButtonPropTypes = {
|
|
13
13
|
},
|
14
14
|
children?: Array<React.ReactChild>,
|
15
15
|
className?: String | Array<String>,
|
16
|
+
dark: Boolean,
|
16
17
|
disabled?: Boolean,
|
17
18
|
fixedWidth?: Boolean,
|
18
19
|
fullWidth?: Boolean,
|
@@ -33,6 +34,7 @@ type ButtonPropTypes = {
|
|
33
34
|
|
34
35
|
const buttonClassName = (props: ButtonPropTypes) => {
|
35
36
|
const {
|
37
|
+
dark = false,
|
36
38
|
disabled = false,
|
37
39
|
fullWidth = false,
|
38
40
|
loading = false,
|
@@ -46,6 +48,7 @@ const buttonClassName = (props: ButtonPropTypes) => {
|
|
46
48
|
className += `${variant !== null ? `_${variant}` : ''}`
|
47
49
|
className += `${type !== null ? `_${type}` : ''}`
|
48
50
|
className += `${size !== null ? `_${size}` : ''}`
|
51
|
+
className += `${dark === true ? '_dark' : ''}`
|
49
52
|
className += `${fullWidth ? '_block' : ''}`
|
50
53
|
className += disabled ? '_disabled' : '_enabled'
|
51
54
|
className += loading ? '_loading' : ''
|
@@ -82,7 +85,7 @@ const Button = (props: ButtonPropTypes) => {
|
|
82
85
|
} = props
|
83
86
|
|
84
87
|
const buttonAria = buttonAriaProps(props)
|
85
|
-
const css = classnames(buttonClassName(props), className,
|
88
|
+
const css = classnames(buttonClassName(props), className, spacing(props))
|
86
89
|
const loadingIcon = (
|
87
90
|
<div className="loading-icon">
|
88
91
|
<Icon
|
@@ -7,6 +7,8 @@ module Playbook
|
|
7
7
|
|
8
8
|
partial "pb_button/button"
|
9
9
|
|
10
|
+
prop :dark, type: Playbook::Props::Boolean,
|
11
|
+
default: false
|
10
12
|
prop :disabled, type: Playbook::Props::Boolean,
|
11
13
|
default: false
|
12
14
|
prop :full_width, type: Playbook::Props::Boolean,
|
@@ -49,7 +51,11 @@ module Playbook
|
|
49
51
|
private
|
50
52
|
|
51
53
|
def classname
|
52
|
-
generate_classname("pb_button_kit", variant, full_width_class, disabled_class, loading_class)
|
54
|
+
generate_classname("pb_button_kit", variant, full_width_class, disabled_class, loading_class, dark_class)
|
55
|
+
end
|
56
|
+
|
57
|
+
def dark_class
|
58
|
+
dark ? "dark" : nil
|
53
59
|
end
|
54
60
|
|
55
61
|
def disabled_class
|
@@ -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 CaptionProps = {
|
9
9
|
aria?: object,
|
@@ -38,7 +38,7 @@ const Caption = (props: CaptionProps) => {
|
|
38
38
|
dark: dark,
|
39
39
|
}),
|
40
40
|
className,
|
41
|
-
|
41
|
+
spacing(props)
|
42
42
|
)
|
43
43
|
|
44
44
|
return (
|
@@ -4,41 +4,38 @@ import React from 'react'
|
|
4
4
|
import { get } from 'lodash'
|
5
5
|
import classnames from 'classnames'
|
6
6
|
import { buildCss } from '../utilities/props'
|
7
|
-
import {
|
7
|
+
import { spacing } from '../utilities/spacing.js'
|
8
8
|
|
9
9
|
type CardPropTypes = {
|
10
|
-
borderNone?: Boolean,
|
11
10
|
children: Array<React.ReactNode> | React.ReactNode,
|
12
11
|
className?: String,
|
13
12
|
highlight?: {
|
14
13
|
position?: "side" | "top",
|
15
14
|
color?: String,
|
16
15
|
},
|
17
|
-
padding?: String,
|
18
16
|
selected?: Boolean,
|
19
17
|
shadow?: "none" | "deep" | "deeper" | "deepest",
|
18
|
+
dark?: Boolean,
|
19
|
+
borderNone?: Boolean,
|
20
20
|
}
|
21
21
|
|
22
22
|
type CardHeaderProps = {
|
23
|
-
categoryColor?: Number,
|
24
23
|
children: Array<React.ReactNode> | React.ReactNode,
|
25
24
|
className?: String,
|
26
|
-
|
25
|
+
categoryColor?: Number,
|
27
26
|
}
|
28
27
|
|
29
28
|
type CardBodyProps = {
|
30
29
|
children: Array<React.ReactNode> | React.ReactNode | String,
|
31
30
|
className?: String,
|
32
|
-
padding?: String,
|
33
31
|
}
|
34
32
|
|
35
33
|
// Header component
|
36
34
|
const Header = (props: CardHeaderProps) => {
|
37
|
-
const { children, className, categoryColor = 1
|
35
|
+
const { children, className, categoryColor = 1 } = props
|
38
36
|
const headerCSS = buildCss('pb_card_header_kit', `category_${categoryColor}`)
|
39
37
|
|
40
|
-
const headerSpacing =
|
41
|
-
|
38
|
+
const headerSpacing = spacing(props) ? spacing(props) : 'p_sm'
|
42
39
|
return (
|
43
40
|
<div className={classnames(headerCSS, className, headerSpacing)}>
|
44
41
|
{children}
|
@@ -48,11 +45,9 @@ const Header = (props: CardHeaderProps) => {
|
|
48
45
|
|
49
46
|
// Body component
|
50
47
|
const Body = (props: CardBodyProps) => {
|
51
|
-
const { children, className
|
48
|
+
const { children, className } = props
|
52
49
|
const bodyCSS = buildCss('pb_card_body_kit')
|
53
|
-
|
54
|
-
const bodySpacing = globalProps(props, { padding })
|
55
|
-
|
50
|
+
const bodySpacing = spacing(props) ? spacing(props) : 'p_md'
|
56
51
|
return (
|
57
52
|
<div className={classnames(bodyCSS, className, bodySpacing)}>
|
58
53
|
{children}
|
@@ -62,22 +57,24 @@ const Body = (props: CardBodyProps) => {
|
|
62
57
|
|
63
58
|
const Card = (props: CardPropTypes) => {
|
64
59
|
const {
|
65
|
-
borderNone = false,
|
66
60
|
children,
|
67
61
|
className,
|
62
|
+
dark = false,
|
68
63
|
highlight = {},
|
69
64
|
selected = false,
|
70
65
|
shadow = 'none',
|
71
|
-
|
66
|
+
borderNone = false,
|
72
67
|
} = props
|
73
68
|
const bodyCSS = buildCss('pb_card_body_kit')
|
74
69
|
const borderCSS = borderNone == true ? 'border_none' : ''
|
75
70
|
const cardCss = buildCss('pb_card_kit', `shadow_${shadow}`, `${borderCSS}`, {
|
71
|
+
dark: dark,
|
76
72
|
selected,
|
77
73
|
deselected: !selected,
|
78
74
|
[`highlight_${highlight.position}`]: highlight.position,
|
79
75
|
[`highlight_${highlight.color}`]: highlight.color,
|
80
76
|
})
|
77
|
+
const cardSpacing = spacing(props) ? spacing(props) : 'p_md'
|
81
78
|
|
82
79
|
// coerce to array
|
83
80
|
const cardChildren =
|
@@ -94,9 +91,9 @@ const Card = (props: CardPropTypes) => {
|
|
94
91
|
const nonHeaderChildren = cardChildren.filter((child) => (get(child, 'type.displayName') !== 'Header'))
|
95
92
|
|
96
93
|
return (
|
97
|
-
<div className={classnames(cardCss,
|
94
|
+
<div className={classnames(cardCss, className)}>
|
98
95
|
{subComponentTags('Header')}
|
99
|
-
<div className={classnames(bodyCSS,
|
96
|
+
<div className={classnames(bodyCSS, cardSpacing)}>
|
100
97
|
{nonHeaderChildren}
|
101
98
|
</div>
|
102
99
|
</div>
|