playbook_ui 8.1.0.pre.alpha1 → 8.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -9
- data/app/pb_kits/playbook/_playbook.scss +0 -2
- data/app/pb_kits/playbook/data/menu.yml +1 -2
- data/app/pb_kits/playbook/index.js +0 -2
- data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +2 -14
- data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +1 -1
- data/app/pb_kits/playbook/pb_avatar/avatar.rb +2 -5
- data/app/pb_kits/playbook/pb_avatar/avatar.test.js +2 -5
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.html.erb +0 -5
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.jsx +0 -5
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_status.html.erb +0 -4
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_status.jsx +0 -4
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.jsx +0 -6
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +1 -2
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +0 -2
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +0 -4
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +0 -4
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +0 -2
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +0 -2
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +0 -2
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +0 -2
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +0 -8
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +0 -8
- data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +0 -2
- data/app/pb_kits/playbook/pb_badge/_badge.jsx +1 -26
- data/app/pb_kits/playbook/pb_button/_button.jsx +0 -6
- data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +1 -0
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +2 -3
- data/app/pb_kits/playbook/pb_caption/caption.rb +1 -1
- data/app/pb_kits/playbook/pb_card/_card.jsx +3 -18
- data/app/pb_kits/playbook/pb_card/card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_card/card.rb +0 -3
- data/app/pb_kits/playbook/pb_card/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_card/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +2 -2
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +2 -2
- data/app/pb_kits/playbook/pb_form/_form.scss +1 -5
- data/app/pb_kits/playbook/pb_form/form_builder.rb +2 -4
- data/app/pb_kits/playbook/pb_form/form_builder/action_area.html.erb +3 -0
- data/app/pb_kits/playbook/pb_form/form_builder/action_area.rb +7 -14
- data/app/pb_kits/playbook/pb_form/simple_form.html.erb +4 -2
- data/app/pb_kits/playbook/pb_form/simple_form.rb +0 -4
- data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +0 -2
- data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +3 -4
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +0 -3
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +0 -3
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +1 -6
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +2 -25
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx +0 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx +3 -7
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +1 -1
- data/app/pb_kits/playbook/plugins/pb_chart.js +1 -1
- data/app/pb_kits/playbook/react_rails_kits.js +0 -4
- data/app/pb_kits/playbook/tokens/_border_radius.scss +10 -0
- data/app/pb_kits/playbook/tokens/_colors.scss +25 -0
- data/app/pb_kits/playbook/tokens/_line_height.scss +9 -0
- data/app/pb_kits/playbook/tokens/_opacity.scss +9 -0
- data/app/pb_kits/playbook/tokens/_positioning.scss +9 -0
- data/app/pb_kits/playbook/tokens/_screen_sizes.scss +9 -0
- data/app/pb_kits/playbook/tokens/_shadows.scss +9 -0
- data/app/pb_kits/playbook/tokens/_spacing.scss +10 -0
- data/app/pb_kits/playbook/tokens/_typography.scss +25 -0
- data/app/pb_kits/playbook/utilities/test-utils.js +0 -6
- data/lib/playbook/version.rb +1 -1
- metadata +13 -58
- data/app/pb_kits/playbook/pb_avatar_action_button/pb_avatar_action_button.test.js +0 -31
- data/app/pb_kits/playbook/pb_button/button.test.js +0 -91
- data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js +0 -46
- data/app/pb_kits/playbook/pb_card/docs/_card_tag.html.erb +0 -25
- data/app/pb_kits/playbook/pb_card/docs/_card_tag.jsx +0 -59
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.test.js +0 -17
- data/app/pb_kits/playbook/pb_dialog/_close_icon.jsx +0 -23
- data/app/pb_kits/playbook/pb_dialog/_dialog.html.erb +0 -10
- data/app/pb_kits/playbook/pb_dialog/_dialog.jsx +0 -142
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +0 -133
- data/app/pb_kits/playbook/pb_dialog/_dialog_context.jsx +0 -3
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.jsx +0 -21
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.jsx +0 -36
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.jsx +0 -68
- data/app/pb_kits/playbook/pb_dialog/dialog.rb +0 -47
- data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +0 -23
- data/app/pb_kits/playbook/pb_dialog/dialog_header.rb +0 -31
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.jsx +0 -53
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.md +0 -2
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default.jsx +0 -27
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_scrollable.jsx +0 -27
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_scrollable.md +0 -2
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_separators.jsx +0 -119
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_separators.md +0 -2
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_should_close_on_overlay.jsx +0 -28
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_should_close_on_overlay.md +0 -2
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_sizes.jsx +0 -93
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -10
- data/app/pb_kits/playbook/pb_dialog/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_inline/_inline.jsx +0 -83
- data/app/pb_kits/playbook/pb_inline/_inline.scss +0 -58
- data/app/pb_kits/playbook/pb_inline/docs/_inline_default.jsx +0 -36
- data/app/pb_kits/playbook/pb_inline/docs/_inline_input_options.jsx +0 -58
- data/app/pb_kits/playbook/pb_inline/docs/_inline_text_options.jsx +0 -99
- data/app/pb_kits/playbook/pb_inline/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_inline/docs/index.js +0 -3
- data/app/pb_kits/playbook/pb_inline/inline.test.jsx +0 -21
- data/app/pb_kits/playbook/tokens/exports/_border_radius.scss +0 -10
- data/app/pb_kits/playbook/tokens/exports/_colors.scss +0 -26
- data/app/pb_kits/playbook/tokens/exports/_line_height.scss +0 -10
- data/app/pb_kits/playbook/tokens/exports/_opacity.scss +0 -10
- data/app/pb_kits/playbook/tokens/exports/_positioning.scss +0 -10
- data/app/pb_kits/playbook/tokens/exports/_screen_sizes.scss +0 -10
- data/app/pb_kits/playbook/tokens/exports/_shadows.scss +0 -10
- data/app/pb_kits/playbook/tokens/exports/_spacing.scss +0 -10
- data/app/pb_kits/playbook/tokens/exports/_typography.scss +0 -24
- data/dist/reset.css +0 -1
data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
<div class="pb--doc-demo-row">
|
2
2
|
|
3
3
|
<%= pb_rails("avatar_action_button", props: {
|
4
|
-
link_aria_label: "Alert Sophia Carden",
|
5
4
|
name: "Sophia Carden",
|
6
5
|
id: "clickable",
|
7
6
|
link_url: "http://www.google.com",
|
8
|
-
image_alt: "Sophia Carden",
|
9
7
|
image_url: "https://randomuser.me/api/portraits/women/8.jpg",
|
10
8
|
}) %>
|
11
9
|
|
data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb
CHANGED
@@ -1,33 +1,25 @@
|
|
1
1
|
<div class="pb--doc-demo-row">
|
2
2
|
|
3
3
|
<%= pb_rails("avatar_action_button", props: {
|
4
|
-
link_aria_label: "Sophia Carden",
|
5
4
|
name: "Sophia Carden",
|
6
|
-
image_alt: "Sophia Carden",
|
7
5
|
image_url: "https://randomuser.me/api/portraits/women/8.jpg",
|
8
6
|
placement: "bottom_left"
|
9
7
|
}) %>
|
10
8
|
|
11
9
|
<%= pb_rails("avatar_action_button", props: {
|
12
|
-
link_aria_label: "Sophia Carden",
|
13
10
|
name: "Sophia Carden",
|
14
|
-
image_alt: "Sophia Carden",
|
15
11
|
image_url: "https://randomuser.me/api/portraits/women/8.jpg",
|
16
12
|
placement: "bottom_right"
|
17
13
|
}) %>
|
18
14
|
|
19
15
|
<%= pb_rails("avatar_action_button", props: {
|
20
|
-
link_aria_label: "Sophia Carden",
|
21
16
|
name: "Sophia Carden",
|
22
|
-
image_alt: "Sophia Carden",
|
23
17
|
image_url: "https://randomuser.me/api/portraits/women/8.jpg",
|
24
18
|
placement: "top_left"
|
25
19
|
}) %>
|
26
20
|
|
27
21
|
<%= pb_rails("avatar_action_button", props: {
|
28
|
-
link_aria_label: "Sophia Carden",
|
29
22
|
name: "Sophia Carden",
|
30
|
-
image_alt: "Sophia Carden",
|
31
23
|
image_url: "https://randomuser.me/api/portraits/women/8.jpg",
|
32
24
|
placement: "top_right"
|
33
25
|
}) %>
|
@@ -4,33 +4,25 @@ import { AvatarActionButton } from '../../'
|
|
4
4
|
const AvatarActionButtonPlacement = (props) => (
|
5
5
|
<div className="pb--doc-demo-row">
|
6
6
|
<AvatarActionButton
|
7
|
-
imageAlt="Sophia Carden"
|
8
7
|
imageUrl="https://randomuser.me/api/portraits/women/8.jpg"
|
9
|
-
linkAriaLabel="Sophia Carden"
|
10
8
|
name="Sophia Carden"
|
11
9
|
placement="bottom_left"
|
12
10
|
{...props}
|
13
11
|
/>
|
14
12
|
<AvatarActionButton
|
15
|
-
imageAlt="Sophia Carden"
|
16
13
|
imageUrl="https://randomuser.me/api/portraits/women/8.jpg"
|
17
|
-
linkAriaLabel="Sophia Carden"
|
18
14
|
name="Sophia Carden"
|
19
15
|
placement="bottom_right"
|
20
16
|
{...props}
|
21
17
|
/>
|
22
18
|
<AvatarActionButton
|
23
|
-
imageAlt="Sophia Carden"
|
24
19
|
imageUrl="https://randomuser.me/api/portraits/women/8.jpg"
|
25
|
-
linkAriaLabel="Sophia Carden"
|
26
20
|
name="Sophia Carden"
|
27
21
|
placement="top_left"
|
28
22
|
{...props}
|
29
23
|
/>
|
30
24
|
<AvatarActionButton
|
31
|
-
imageAlt="Sophia Carden"
|
32
25
|
imageUrl="https://randomuser.me/api/portraits/women/8.jpg"
|
33
|
-
linkAriaLabel="Sophia Carden"
|
34
26
|
name="Sophia Carden"
|
35
27
|
placement="top_right"
|
36
28
|
{...props}
|
data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
<div class="pb--doc-demo-row">
|
2
2
|
|
3
3
|
<%= pb_rails("avatar_action_button", props: {
|
4
|
-
link_aria_label: "Sophia Carden",
|
5
4
|
name: "Sophia Carden",
|
6
5
|
link_url: "http://www.google.com",
|
7
|
-
image_alt: "Sophia Carden",
|
8
6
|
image_url: "https://randomuser.me/api/portraits/women/8.jpg",
|
9
7
|
tooltip_text: "Tooltip Text",
|
10
8
|
tooltip_id: "avatar_1",
|
@@ -3,7 +3,6 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { globalProps } from '../utilities/globalProps.js'
|
6
|
-
import { Icon } from '../'
|
7
6
|
|
8
7
|
import {
|
9
8
|
buildAriaProps,
|
@@ -14,15 +13,8 @@ import {
|
|
14
13
|
type BadgeProps = {
|
15
14
|
aria?: object,
|
16
15
|
className?: string,
|
17
|
-
closeProps?: {
|
18
|
-
onClick?: EventHandler,
|
19
|
-
onMouseDown?: EventHandler,
|
20
|
-
onTouchEnd?: EventHandler,
|
21
|
-
},
|
22
16
|
data?: object,
|
23
17
|
id?: string,
|
24
|
-
removeIcon?: Boolean,
|
25
|
-
removeOnClick?: EventHandler,
|
26
18
|
rounded?: boolean,
|
27
19
|
text?: string,
|
28
20
|
variant?: "error" | "info" | "neutral" | "primary" | "success" | "warning",
|
@@ -31,11 +23,8 @@ const Badge = (props: BadgeProps) => {
|
|
31
23
|
const {
|
32
24
|
aria = {},
|
33
25
|
className,
|
34
|
-
closeProps = {},
|
35
26
|
data = {},
|
36
27
|
id,
|
37
|
-
removeIcon = false,
|
38
|
-
removeOnClick = () => {},
|
39
28
|
rounded = false,
|
40
29
|
text,
|
41
30
|
variant = 'neutral',
|
@@ -55,21 +44,7 @@ const Badge = (props: BadgeProps) => {
|
|
55
44
|
className={css}
|
56
45
|
id={id}
|
57
46
|
>
|
58
|
-
<span>
|
59
|
-
<If condition={removeIcon}>
|
60
|
-
<span
|
61
|
-
onClick={removeOnClick}
|
62
|
-
style={{ cursor: 'pointer' }}
|
63
|
-
{...closeProps}
|
64
|
-
>
|
65
|
-
<Icon
|
66
|
-
fixedWidth
|
67
|
-
icon="times"
|
68
|
-
/>
|
69
|
-
</span>
|
70
|
-
</If>
|
71
|
-
{text}
|
72
|
-
</span>
|
47
|
+
<span>{text}</span>
|
73
48
|
</div>
|
74
49
|
)
|
75
50
|
}
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
|
-
import { buildDataProps } from '../utilities/props'
|
6
5
|
import { globalProps } from '../utilities/globalProps.js'
|
7
6
|
|
8
7
|
import Icon from '../pb_icon/_icon.jsx'
|
@@ -14,7 +13,6 @@ type ButtonPropTypes = {
|
|
14
13
|
},
|
15
14
|
children?: array<React.ReactChild>,
|
16
15
|
className?: string | array<string>,
|
17
|
-
data?: object,
|
18
16
|
disabled?: boolean,
|
19
17
|
fixedWidth?: boolean,
|
20
18
|
fullWidth?: boolean,
|
@@ -71,7 +69,6 @@ const Button = (props: ButtonPropTypes) => {
|
|
71
69
|
const {
|
72
70
|
children,
|
73
71
|
className,
|
74
|
-
data = {},
|
75
72
|
disabled,
|
76
73
|
icon = null,
|
77
74
|
id,
|
@@ -85,7 +82,6 @@ const Button = (props: ButtonPropTypes) => {
|
|
85
82
|
} = props
|
86
83
|
|
87
84
|
const buttonAria = buttonAriaProps(props)
|
88
|
-
const dataProps = buildDataProps(data)
|
89
85
|
const css = classnames(
|
90
86
|
buttonClassName(props),
|
91
87
|
globalProps(props),
|
@@ -115,7 +111,6 @@ const Button = (props: ButtonPropTypes) => {
|
|
115
111
|
<If condition={link !== null}>
|
116
112
|
<a
|
117
113
|
{...buttonAria}
|
118
|
-
{...dataProps}
|
119
114
|
className={css}
|
120
115
|
href={link}
|
121
116
|
id={id}
|
@@ -127,7 +122,6 @@ const Button = (props: ButtonPropTypes) => {
|
|
127
122
|
<Else />
|
128
123
|
<button
|
129
124
|
{...buttonAria}
|
130
|
-
{...dataProps}
|
131
125
|
className={css}
|
132
126
|
disabled={disabled}
|
133
127
|
id={id}
|
@@ -12,7 +12,7 @@ type CaptionProps = {
|
|
12
12
|
data?: object,
|
13
13
|
id?: string,
|
14
14
|
size?: "xs" | "sm" | "md" | "lg" | "xl",
|
15
|
-
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div"
|
15
|
+
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div",
|
16
16
|
text?: string,
|
17
17
|
variant?: null | "link",
|
18
18
|
}
|
@@ -29,8 +29,7 @@ const Caption = (props: CaptionProps) => {
|
|
29
29
|
text,
|
30
30
|
variant = null,
|
31
31
|
} = props
|
32
|
-
const
|
33
|
-
const Tag = tagOptions.includes(tag) ? tag : 'div'
|
32
|
+
const Tag = `${tag}`
|
34
33
|
|
35
34
|
const ariaProps = buildAriaProps(aria)
|
36
35
|
const dataProps = buildDataProps(data)
|
@@ -7,7 +7,7 @@ module Playbook
|
|
7
7
|
values: %w[xs sm md base lg xl],
|
8
8
|
default: "md"
|
9
9
|
prop :tag, type: Playbook::Props::Enum,
|
10
|
-
values: %w[h1 h2 h3 h4 h5 h6 p span div
|
10
|
+
values: %w[h1 h2 h3 h4 h5 h6 p span div],
|
11
11
|
default: "div"
|
12
12
|
prop :text
|
13
13
|
prop :variant, type: Playbook::Props::Enum,
|
@@ -3,16 +3,14 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import { get } from 'lodash'
|
5
5
|
import classnames from 'classnames'
|
6
|
-
import {
|
6
|
+
import { buildCss } from '../utilities/props'
|
7
7
|
import { globalProps } from '../utilities/globalProps.js'
|
8
8
|
|
9
9
|
type CardPropTypes = {
|
10
|
-
aria?: object,
|
11
10
|
borderNone?: boolean,
|
12
11
|
borderRadius?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | "rounded",
|
13
12
|
children: array<React.ReactNode> | React.ReactNode,
|
14
13
|
className?: string,
|
15
|
-
data?: object,
|
16
14
|
highlight?: {
|
17
15
|
position?: "side" | "top",
|
18
16
|
color?: string,
|
@@ -20,7 +18,6 @@ type CardPropTypes = {
|
|
20
18
|
padding?: string,
|
21
19
|
selected?: boolean,
|
22
20
|
shadow?: "none" | "deep" | "deeper" | "deepest",
|
23
|
-
tag?: "div" | "section" | "footer" | "header" | "article" | "aside" | "main" | "nav",
|
24
21
|
}
|
25
22
|
|
26
23
|
type CardHeaderProps = {
|
@@ -65,16 +62,13 @@ const Body = (props: CardBodyProps) => {
|
|
65
62
|
|
66
63
|
const Card = (props: CardPropTypes) => {
|
67
64
|
const {
|
68
|
-
aria = {},
|
69
65
|
borderNone = false,
|
70
66
|
borderRadius = 'md',
|
71
67
|
children,
|
72
68
|
className,
|
73
|
-
data = {},
|
74
69
|
highlight = {},
|
75
70
|
selected = false,
|
76
71
|
shadow = 'none',
|
77
|
-
tag = 'div',
|
78
72
|
padding = 'md',
|
79
73
|
} = props
|
80
74
|
const borderCSS = borderNone == true ? 'border_none' : ''
|
@@ -84,8 +78,6 @@ const Card = (props: CardPropTypes) => {
|
|
84
78
|
[`highlight_${highlight.position}`]: highlight.position,
|
85
79
|
[`highlight_${highlight.color}`]: highlight.color,
|
86
80
|
})
|
87
|
-
const ariaProps = buildAriaProps(aria)
|
88
|
-
const dataProps = buildDataProps(data)
|
89
81
|
|
90
82
|
// coerce to array
|
91
83
|
const cardChildren =
|
@@ -101,18 +93,11 @@ const Card = (props: CardPropTypes) => {
|
|
101
93
|
|
102
94
|
const nonHeaderChildren = cardChildren.filter((child) => (get(child, 'type.displayName') !== 'Header'))
|
103
95
|
|
104
|
-
const tagOptions = ['div', 'section', 'footer', 'header', 'article', 'aside', 'main', 'nav']
|
105
|
-
const Tag = tagOptions.includes(tag) ? tag : 'div'
|
106
|
-
|
107
96
|
return (
|
108
|
-
<
|
109
|
-
{...ariaProps}
|
110
|
-
{...dataProps}
|
111
|
-
className={classnames(cardCss, globalProps(props, { padding }), className)}
|
112
|
-
>
|
97
|
+
<div className={classnames(cardCss, globalProps(props, { padding }), className)}>
|
113
98
|
{subComponentTags('Header')}
|
114
99
|
{nonHeaderChildren}
|
115
|
-
</
|
100
|
+
</div>
|
116
101
|
)
|
117
102
|
}
|
118
103
|
|
@@ -9,9 +9,6 @@ module Playbook
|
|
9
9
|
default: "none"
|
10
10
|
prop :highlight, type: Playbook::Props::Hash,
|
11
11
|
default: {}
|
12
|
-
prop :tag, type: Playbook::Props::Enum,
|
13
|
-
values: %w[div section footer header article aside main nav],
|
14
|
-
default: "div"
|
15
12
|
prop :border_none, type: Playbook::Props::Boolean,
|
16
13
|
default: false
|
17
14
|
prop :border_radius, type: Playbook::Props::Enum,
|
@@ -4,7 +4,6 @@ examples:
|
|
4
4
|
- card_highlight: Highlight Cards
|
5
5
|
- card_header: Header Cards
|
6
6
|
- card_selected: Selected
|
7
|
-
- card_tag: HTML Tag
|
8
7
|
- card_padding: Padding Size
|
9
8
|
- card_shadow: Shadow Size
|
10
9
|
- card_content: Content Size
|
@@ -16,7 +15,6 @@ examples:
|
|
16
15
|
- card_highlight: Highlight Cards
|
17
16
|
- card_header: Header Cards
|
18
17
|
- card_selected: Selected
|
19
|
-
- card_tag: HTML Tag
|
20
18
|
- card_padding: Padding Size
|
21
19
|
- card_shadow: Shadow Size
|
22
20
|
- card_content: Content Size
|
@@ -2,7 +2,6 @@ export { default as CardLight } from './_card_light.jsx'
|
|
2
2
|
export { default as CardHighlight } from './_card_highlight.jsx'
|
3
3
|
export { default as CardHeader } from './_card_header.jsx'
|
4
4
|
export { default as CardSelected } from './_card_selected.jsx'
|
5
|
-
export { default as CardTag } from './_card_tag.jsx'
|
6
5
|
export { default as CardPadding } from './_card_padding.jsx'
|
7
6
|
export { default as CardShadow } from './_card_shadow.jsx'
|
8
7
|
export { default as CardContent } from './_card_content.jsx'
|
@@ -19,11 +19,9 @@ module Playbook
|
|
19
19
|
prepend(CollectionSelectField)
|
20
20
|
prepend(CheckboxField)
|
21
21
|
prepend(DatePickerField)
|
22
|
-
end
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
yield ActionArea.new(@template, submit_default_value)
|
23
|
+
def actions(&block)
|
24
|
+
@template.render_component ActionArea.new(submit_default_value: submit_default_value, children: block)
|
27
25
|
end
|
28
26
|
end
|
29
27
|
end
|
@@ -3,29 +3,22 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbForm
|
5
5
|
module FormBuilder
|
6
|
-
class ActionArea
|
7
|
-
|
8
|
-
self.view_context = view_context
|
9
|
-
self.submit_default_value = submit_default_value
|
10
|
-
end
|
6
|
+
class ActionArea < Playbook::KitBase
|
7
|
+
prop :submit_default_value, type: Playbook::Props::String
|
11
8
|
|
12
9
|
def submit(value = nil, props: {})
|
13
10
|
props[:type] ||= "submit"
|
14
|
-
props[:text] ||= value || submit_default_value
|
15
|
-
|
16
11
|
button(value, props: props)
|
17
12
|
end
|
18
13
|
|
19
14
|
def button(value = nil, props:)
|
20
|
-
|
21
|
-
|
15
|
+
props[:text] ||= value || submit_default_value
|
16
|
+
|
17
|
+
content_tag(:li) do
|
18
|
+
pb_rails("button", props: props)
|
22
19
|
end
|
23
20
|
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
attr_accessor :view_context, :submit_default_value
|
28
21
|
end
|
29
22
|
end
|
30
23
|
end
|
31
|
-
end
|
24
|
+
end
|