playbook_ui 2.9.4 → 2.9.5
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/pb_body/_body.html.erb +2 -2
- data/app/pb_kits/playbook/pb_body/body.rb +20 -80
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.html.erb +4 -2
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +18 -14
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +5 -6
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +0 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_checked.html.erb +0 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_dark.html.erb +0 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_dark.jsx +1 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_default.html.erb +0 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_contact/_contact.html.erb +5 -2
- data/app/pb_kits/playbook/pb_contact/contact.rb +22 -50
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.html.erb +3 -3
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +11 -49
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.html.erb +2 -2
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.jsx +20 -3
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_dark.html.erb +6 -5
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_dark.jsx +5 -4
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default.html.erb +5 -4
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default.jsx +5 -3
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_modified.html.erb +8 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_modified.jsx +17 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +5 -4
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.html.erb +2 -2
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.rb +12 -56
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.html.erb +7 -4
- data/app/pb_kits/playbook/pb_icon_value/icon_value.rb +10 -67
- data/app/pb_kits/playbook/pb_image/_image.html.erb +2 -2
- data/app/pb_kits/playbook/pb_image/image.rb +7 -48
- data/app/pb_kits/playbook/pb_person/_person.html.erb +3 -3
- data/app/pb_kits/playbook/pb_person/person.rb +7 -45
- data/app/pb_kits/playbook/pb_source/_source.html.erb +10 -7
- data/app/pb_kits/playbook/pb_source/source.rb +22 -67
- data/app/pb_kits/playbook/pb_table/_table.html.erb +2 -2
- data/app/pb_kits/playbook/pb_table/_table.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_container.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_container.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_container_dark.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_container_dark.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_dark.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_dark.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_disable_hover.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_disable_hover.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_lg.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_lg.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_md.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_md.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_multiline.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_multiline.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_single_line.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_single_line.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sm.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sm.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/table.rb +30 -76
- data/app/pb_kits/playbook/pb_toggle/_toggle.html.erb +6 -3
- data/app/pb_kits/playbook/pb_toggle/toggle.rb +12 -68
- data/app/pb_kits/playbook/props.rb +1 -1
- data/app/pb_kits/playbook/props/base.rb +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 538626b25c8cfe2a426a8cb708a5bc832dc50e5cac5fc73d1c2c6f5eb7a9bafc
|
4
|
+
data.tar.gz: 02ec4a247e32c0e92372b0da5fd4a2060daa333b86a6dc410b9047e3749b3526
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7a4624ab3daffb11381327e70a0bee6e9ec820a831b0989b3637b872f07da29dc763f51218ae2f512c65e61f906adb8385bb9dbeed8f1846d5d8c75b792d19b
|
7
|
+
data.tar.gz: 02d4a3bf6b766d826e2cba344bcee3c918657e62e393ded122617144f7e8bd12844e96d06ee80f716fe76396d528d10f62de7186f92ab0a767586cb91694ea62
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= content_tag(object.tag,
|
2
2
|
id: object.id,
|
3
3
|
data: object.data,
|
4
|
-
class: object.classname
|
5
|
-
<%= object.
|
4
|
+
class: object.classname) do %>
|
5
|
+
<%= !object.children.nil? ? capture(&object.children) : object.text %>
|
6
6
|
<% end %>
|
@@ -2,101 +2,41 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbBody
|
5
|
-
class Body
|
6
|
-
|
7
|
-
configured_classname
|
8
|
-
configured_color
|
9
|
-
configured_dark
|
10
|
-
configured_data
|
11
|
-
configured_id
|
12
|
-
configured_tag
|
13
|
-
configured_text
|
14
|
-
configured_status
|
15
|
-
block].freeze
|
5
|
+
class Body
|
6
|
+
include Playbook::Props
|
16
7
|
|
17
|
-
|
18
|
-
classname: default_configuration,
|
19
|
-
color: default_configuration,
|
20
|
-
dark: default_configuration,
|
21
|
-
data: default_configuration,
|
22
|
-
id: default_configuration,
|
23
|
-
status: default_configuration,
|
24
|
-
tag: default_configuration,
|
25
|
-
text: default_configuration,
|
26
|
-
&block)
|
8
|
+
partial "pb_body/body"
|
27
9
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
10
|
+
prop :color, type: Playbook::Props::Enum,
|
11
|
+
values: %w[default light lighter dark light_dark lighter_dark],
|
12
|
+
default: "default"
|
13
|
+
prop :dark, type: Playbook::Props::Boolean,
|
14
|
+
default: false
|
15
|
+
prop :status, type: Playbook::Props::Enum,
|
16
|
+
values: %w[neutral negative positive],
|
17
|
+
default: "neutral"
|
18
|
+
prop :tag, type: Playbook::Props::Enum,
|
19
|
+
values: %w[h1 h2 h3 h4 h5 h6 p span div],
|
20
|
+
default: "div"
|
21
|
+
prop :text
|
39
22
|
|
40
|
-
def
|
41
|
-
|
42
|
-
one_of_value(configured_color, color_options, "default")
|
23
|
+
def classname
|
24
|
+
generate_classname("pb_body_kit", color_class, dark_class, status_class)
|
43
25
|
end
|
44
26
|
|
27
|
+
private
|
28
|
+
|
45
29
|
def color_class
|
46
30
|
color != "default" ? color : nil
|
47
31
|
end
|
48
32
|
|
49
|
-
def dark
|
50
|
-
is_true? configured_dark
|
51
|
-
end
|
52
|
-
|
53
33
|
def dark_class
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
def status
|
58
|
-
status_options = %w[neutral negative positive]
|
59
|
-
one_of_value(configured_status, status_options, "neutral")
|
34
|
+
dark ? "dark" : nil
|
60
35
|
end
|
61
36
|
|
62
37
|
def status_class
|
63
38
|
status != "neutral" ? status : nil
|
64
39
|
end
|
65
|
-
|
66
|
-
def tag
|
67
|
-
default_value(configured_tag, "div")
|
68
|
-
end
|
69
|
-
|
70
|
-
def text
|
71
|
-
default_value(configured_text, "Body text")
|
72
|
-
end
|
73
|
-
|
74
|
-
def yield(context:)
|
75
|
-
!block.nil? ? context.capture(&block) : text
|
76
|
-
end
|
77
|
-
|
78
|
-
def kit_class
|
79
|
-
body_options = [
|
80
|
-
"pb_body_kit",
|
81
|
-
color_class,
|
82
|
-
dark_class,
|
83
|
-
status_class,
|
84
|
-
]
|
85
|
-
body_options.compact.join("_")
|
86
|
-
end
|
87
|
-
|
88
|
-
def to_partial_path
|
89
|
-
"pb_body/body"
|
90
|
-
end
|
91
|
-
|
92
|
-
private
|
93
|
-
|
94
|
-
DEFAULT = Object.new
|
95
|
-
private_constant :DEFAULT
|
96
|
-
def default_configuration
|
97
|
-
DEFAULT
|
98
|
-
end
|
99
|
-
attr_accessor(*PROPS)
|
100
40
|
end
|
101
41
|
end
|
102
42
|
end
|
@@ -3,7 +3,9 @@
|
|
3
3
|
class: object.classname) do %>
|
4
4
|
<input type="checkbox" value="<%=object.value%>" name="<%=object.name%>" <%= object.checked_html %>>
|
5
5
|
<span class="pb_checkbox_checkmark">
|
6
|
-
<%= pb_rails("icon", props: { icon: "check", id: "check_icon", classname: "check_icon", fixed_width: true})
|
6
|
+
<%= pb_rails("icon", props: { icon: "check", id: "check_icon", classname: "check_icon", fixed_width: true}) %>
|
7
|
+
</span>
|
8
|
+
<span class="pb_checkbox_label">
|
9
|
+
<%= pb_rails("body", props: { text: object.text, dark: object.dark }) %>
|
7
10
|
</span>
|
8
|
-
<span class="pb_checkbox_label"><%= object.text %></span>
|
9
11
|
<% end %>
|
@@ -1,41 +1,45 @@
|
|
1
1
|
/* @flow */
|
2
2
|
|
3
3
|
import React from 'react'
|
4
|
+
import Body from '../pb_body/_body.jsx'
|
5
|
+
import Icon from '../pb_icon/_icon.jsx'
|
4
6
|
|
5
7
|
type CheckboxProps = {
|
8
|
+
checked?: Boolean,
|
6
9
|
dark?: Boolean,
|
7
|
-
tag: String,
|
8
|
-
label: String,
|
9
10
|
name:String,
|
11
|
+
text: String,
|
10
12
|
value:String,
|
11
|
-
|
13
|
+
|
12
14
|
}
|
13
15
|
|
14
16
|
const Checkbox = ({
|
17
|
+
checked=false,
|
15
18
|
dark=false,
|
16
|
-
tag='label',
|
17
|
-
label,
|
18
19
|
name='',
|
20
|
+
text='',
|
19
21
|
value='',
|
20
|
-
checked=false,
|
21
|
-
}: CheckboxProps) => {
|
22
22
|
|
23
|
-
|
23
|
+
|
24
|
+
}: CheckboxProps) => {
|
25
|
+
|
26
|
+
const bodyClassName = {
|
27
|
+
'pb_checkbox_label': true,
|
28
|
+
'_dark': dark,
|
29
|
+
}
|
24
30
|
|
25
31
|
return (
|
26
|
-
<
|
32
|
+
<label
|
27
33
|
className={
|
28
34
|
`pb_checkbox_kit` +
|
29
35
|
(dark === true ? '_dark' : '')
|
30
36
|
}
|
31
37
|
> <input type="checkbox" name={name} value={value} defaultChecked={checked}/>
|
32
38
|
<span className="pb_checkbox_checkmark">
|
33
|
-
<
|
34
|
-
</span>
|
35
|
-
<span className="pb_checkbox_label">
|
36
|
-
{label}
|
39
|
+
<Icon className="check_icon" icon="check" fixedWidth />
|
37
40
|
</span>
|
38
|
-
</
|
41
|
+
<Body className={bodyClassName}>{text}</Body>
|
42
|
+
</label>
|
39
43
|
)
|
40
44
|
}
|
41
45
|
|
@@ -2,16 +2,15 @@
|
|
2
2
|
$transition: $transition_cubic;
|
3
3
|
|
4
4
|
[class^=pb_checkbox_kit] {
|
5
|
+
display: inline-flex;
|
5
6
|
.pb_checkbox_label {
|
6
|
-
|
7
|
-
position: relative;
|
8
|
-
padding-left: $space_lg;
|
7
|
+
padding-left: $space_xs;
|
9
8
|
cursor: pointer;
|
10
9
|
font-size: $text_lt_default;
|
11
10
|
user-select: none;
|
12
11
|
}
|
13
12
|
.pb_checkbox_checkmark {
|
14
|
-
position:
|
13
|
+
position: relative;
|
15
14
|
height: 22px;
|
16
15
|
width: 22px;
|
17
16
|
border: solid $border_light 2px;
|
@@ -33,7 +32,7 @@ $transition: $transition_cubic;
|
|
33
32
|
}
|
34
33
|
|
35
34
|
input {
|
36
|
-
position:
|
35
|
+
position: relative;
|
37
36
|
opacity: 0;
|
38
37
|
cursor: pointer;
|
39
38
|
height: 0;
|
@@ -44,7 +43,7 @@ $transition: $transition_cubic;
|
|
44
43
|
border-color: $primary_action;
|
45
44
|
}
|
46
45
|
&:checked ~ .pb_checkbox_checkmark {
|
47
|
-
display: block;
|
46
|
+
display: inline-block;
|
48
47
|
.check_icon{
|
49
48
|
opacity: $opacity_10;
|
50
49
|
}
|
@@ -1,6 +1,9 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
2
|
id: object.id,
|
3
3
|
data: object.data,
|
4
|
-
class: object.classname
|
5
|
-
|
4
|
+
class: object.classname) do %>
|
5
|
+
<%= pb_rails("body", props: { tag: "span", classname: "pb_contact_kit", color: "light" }) do %>
|
6
|
+
<%= pb_rails("icon", props: { icon: object.contact_icon, fixed_width: true }) %>
|
7
|
+
<%= object.formatted_contact_value if object.contact_value%>
|
8
|
+
<% end %>
|
6
9
|
<% end %>
|
@@ -4,75 +4,47 @@ require "action_view"
|
|
4
4
|
|
5
5
|
module Playbook
|
6
6
|
module PbContact
|
7
|
-
class Contact
|
7
|
+
class Contact
|
8
8
|
include ActionView::Helpers::NumberHelper
|
9
|
+
include Playbook::Props
|
9
10
|
|
10
|
-
|
11
|
-
configured_data
|
12
|
-
configured_id
|
13
|
-
configured_contact_type
|
14
|
-
configured_contact_value].freeze
|
11
|
+
partial "pb_contact/contact"
|
15
12
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
self.configured_classname = classname
|
22
|
-
self.configured_data = data
|
23
|
-
self.configured_id = id
|
24
|
-
self.configured_contact_type = contact_type
|
25
|
-
self.configured_contact_value = contact_value
|
13
|
+
prop :contact_type
|
14
|
+
prop :contact_value
|
15
|
+
|
16
|
+
def classname
|
17
|
+
generate_classname("pb_contact_kit")
|
26
18
|
end
|
27
19
|
|
28
|
-
def
|
29
|
-
case
|
20
|
+
def contact_icon
|
21
|
+
case contact_type
|
30
22
|
when "cell"
|
31
|
-
|
23
|
+
"mobile"
|
32
24
|
when "home"
|
33
|
-
|
25
|
+
"phone"
|
34
26
|
when "work"
|
35
|
-
|
27
|
+
"phone-office"
|
36
28
|
when "email"
|
37
|
-
|
29
|
+
"envelope"
|
38
30
|
else # "unknown" || "other"
|
39
|
-
|
31
|
+
"phone"
|
40
32
|
end
|
41
|
-
contact_type_props = { icon: icon, fixed_width: true }
|
42
|
-
pb_contact_type = Playbook::PbIcon::Icon.new(contact_type_props)
|
43
|
-
ApplicationController.renderer.render(partial: pb_contact_type, as: :object)
|
44
33
|
end
|
45
34
|
|
46
|
-
def
|
47
|
-
if
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
new_value = configured_contact_value
|
52
|
-
end
|
53
|
-
pb_body = Playbook::PbBody::Body.new(color: "light") do
|
54
|
-
contact_type + new_value
|
55
|
-
end
|
56
|
-
ApplicationController.renderer.render(partial: pb_body, as: :object)
|
35
|
+
def formatted_contact_value
|
36
|
+
if contact_type == "email"
|
37
|
+
contact_value
|
38
|
+
else
|
39
|
+
number_to_phone(formatted_value, area_code: true)
|
57
40
|
end
|
58
41
|
end
|
59
42
|
|
60
|
-
def formatted_value
|
61
|
-
configured_contact_value.to_s.gsub(/\D/, "")
|
62
|
-
end
|
63
|
-
|
64
|
-
def to_partial_path
|
65
|
-
"pb_contact/contact"
|
66
|
-
end
|
67
|
-
|
68
43
|
private
|
69
44
|
|
70
|
-
|
71
|
-
|
72
|
-
def default_configuration
|
73
|
-
DEFAULT
|
45
|
+
def formatted_value
|
46
|
+
contact_value.to_s.gsub(/\D/, "")
|
74
47
|
end
|
75
|
-
attr_accessor(*PROPS)
|
76
48
|
end
|
77
49
|
end
|
78
50
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
2
|
id: object.id,
|
3
3
|
data: object.data,
|
4
|
-
class: object.classname
|
5
|
-
<%= object.
|
6
|
-
<%= object.text
|
4
|
+
class: object.classname) do %>
|
5
|
+
<%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon" }) %>
|
6
|
+
<%= pb_rails("title", props: { text: object.text, size: 4, classname: "pb_fixed_confirmation_toast_text" }) if object.show_text?%>
|
7
7
|
<% end %>
|
@@ -2,48 +2,19 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbFixedConfirmationToast
|
5
|
-
class FixedConfirmationToast
|
6
|
-
|
7
|
-
configured_data
|
8
|
-
configured_id
|
9
|
-
configured_status
|
10
|
-
configured_text].freeze
|
5
|
+
class FixedConfirmationToast
|
6
|
+
include Playbook::Props
|
11
7
|
|
12
|
-
|
13
|
-
data: default_configuration,
|
14
|
-
id: default_configuration,
|
15
|
-
status: default_configuration,
|
16
|
-
text: default_configuration)
|
17
|
-
self.configured_classname = classname
|
18
|
-
self.configured_data = data
|
19
|
-
self.configured_id = id
|
20
|
-
self.configured_status = status
|
21
|
-
self.configured_text = text
|
22
|
-
end
|
8
|
+
partial "pb_fixed_confirmation_toast/fixed_confirmation_toast"
|
23
9
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
29
|
-
end
|
10
|
+
prop :status, type: Playbook::Props::Enum,
|
11
|
+
values: %w[success error neutral],
|
12
|
+
default: "neutral"
|
13
|
+
prop :text, type: Playbook::Props::String
|
30
14
|
|
31
|
-
def kit_class
|
32
|
-
kit_options = [
|
33
|
-
"pb_fixed_confirmation_toast_kit",
|
34
|
-
status,
|
35
|
-
]
|
36
|
-
kit_options.join("_")
|
37
|
-
end
|
38
15
|
|
39
|
-
def
|
40
|
-
|
41
|
-
one_of_value(configured_status, status_options, "neutral")
|
42
|
-
end
|
43
|
-
|
44
|
-
def icon
|
45
|
-
pb_icon = Playbook::PbIcon::Icon.new(icon: icon_value, classname: "pb_icon")
|
46
|
-
ApplicationController.renderer.render(partial: pb_icon, as: :object)
|
16
|
+
def show_text?
|
17
|
+
text.present?
|
47
18
|
end
|
48
19
|
|
49
20
|
def icon_value
|
@@ -57,18 +28,9 @@ module Playbook
|
|
57
28
|
end
|
58
29
|
end
|
59
30
|
|
60
|
-
def
|
61
|
-
"
|
62
|
-
end
|
63
|
-
|
64
|
-
private
|
65
|
-
|
66
|
-
DEFAULT = Object.new
|
67
|
-
private_constant :DEFAULT
|
68
|
-
def default_configuration
|
69
|
-
DEFAULT
|
31
|
+
def classname
|
32
|
+
generate_classname("pb_fixed_confirmation_toast_kit", status)
|
70
33
|
end
|
71
|
-
attr_accessor(*PROPS)
|
72
34
|
end
|
73
35
|
end
|
74
36
|
end
|