playbook_ui 2.9.2 → 2.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/pb.logo.svg +28 -0
- data/app/helpers/playbook/pb_doc_helper.rb +9 -12
- data/app/helpers/playbook/pb_kit_helper.rb +12 -30
- data/app/pb_kits/playbook/_playbook.scss +50 -0
- data/app/pb_kits/playbook/index.js +10 -9
- data/app/pb_kits/playbook/kits/pb_contact.js +4 -0
- data/app/pb_kits/playbook/kits/pb_person.js +4 -0
- data/app/pb_kits/playbook/kits/pb_person_contact.js +4 -0
- data/app/pb_kits/playbook/packs/application.js +3 -3
- data/app/pb_kits/playbook/packs/examples.js +85 -127
- data/app/pb_kits/playbook/packs/kits.js +36 -36
- data/app/pb_kits/playbook/packs/main.scss +1 -1
- data/app/pb_kits/playbook/packs/site_styles/_site-style.scss +7 -0
- data/app/pb_kits/playbook/pb_bar_graph/barGraphSettings.js +1 -1
- data/app/pb_kits/playbook/pb_button/_button.jsx +48 -49
- data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +8 -2
- data/app/pb_kits/playbook/pb_card/_card.html.erb +2 -2
- data/app/pb_kits/playbook/pb_card/child_kits/_card_body.html.erb +1 -1
- data/app/pb_kits/playbook/pb_contact/_contact.html.erb +6 -0
- data/app/pb_kits/playbook/pb_contact/_contact.jsx +72 -0
- data/app/pb_kits/playbook/{pb_phone/_phone.scss → pb_contact/_contact.scss} +0 -0
- data/app/pb_kits/playbook/pb_contact/contact.rb +78 -0
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +18 -0
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +26 -0
- data/app/pb_kits/playbook/pb_contact/docs/example.yml +8 -0
- data/app/pb_kits/playbook/pb_contact/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +16 -13
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.html.erb +2 -2
- data/app/pb_kits/playbook/pb_hashtag/hashtag.rb +20 -59
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.html.erb +3 -3
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +18 -61
- data/app/pb_kits/playbook/pb_input/_input.html.erb +1 -1
- data/app/pb_kits/playbook/pb_input/_input.jsx +2 -2
- data/app/pb_kits/playbook/pb_input/_input.scss +1 -1
- data/app/pb_kits/playbook/pb_input/input.rb +10 -79
- data/app/pb_kits/playbook/pb_line_graph/lineGraphSettings.js +1 -1
- data/app/pb_kits/playbook/{pb_owner/_owner.html.erb → pb_person/_person.html.erb} +1 -1
- data/app/pb_kits/playbook/pb_person/_person.jsx +36 -0
- data/app/pb_kits/playbook/{pb_owner/_owner.scss → pb_person/_person.scss} +2 -2
- data/app/pb_kits/playbook/pb_person/docs/_person_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_person/docs/_person_default.jsx +13 -0
- data/app/pb_kits/playbook/pb_person/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_person/docs/index.js +1 -0
- data/app/pb_kits/playbook/{pb_owner/owner.rb → pb_person/person.rb} +18 -14
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.html.erb +12 -0
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +49 -0
- data/app/pb_kits/playbook/{pb_owner_phone/_owner_phone.scss → pb_person_contact/_person_contact.scss} +3 -3
- data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_default.html.erb +21 -0
- data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_default.jsx +34 -0
- data/app/pb_kits/playbook/pb_person_contact/docs/example.yml +8 -0
- data/app/pb_kits/playbook/pb_person_contact/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_person_contact/person_contact.rb +55 -0
- data/app/pb_kits/playbook/props.rb +4 -4
- data/app/pb_kits/playbook/props/base.rb +7 -3
- data/app/pb_kits/playbook/props/number.rb +11 -0
- data/app/pb_kits/playbook/props/proc.rb +11 -0
- data/app/pb_kits/playbook/tokens/_colors.scss +12 -8
- data/app/views/layouts/playbook/_nav.html.slim +2 -2
- data/app/views/playbook/pages/principles.html.slim +0 -2
- data/fonts/fontawesome.min.js +5 -0
- data/fonts/regular.min.js +5 -0
- data/lib/generators/kit/kit_generator.rb +2 -2
- data/lib/playbook/version.rb +1 -1
- metadata +35 -32
- data/app/pb_kits/playbook/kits/pb_owner.js +0 -4
- data/app/pb_kits/playbook/kits/pb_owner_phone.js +0 -4
- data/app/pb_kits/playbook/kits/pb_phone.js +0 -4
- data/app/pb_kits/playbook/packs/site_styles/_kit_style_index.scss +0 -50
- data/app/pb_kits/playbook/pb_owner/_owner.jsx +0 -21
- data/app/pb_kits/playbook/pb_owner/docs/_owner_default.html.erb +0 -1
- data/app/pb_kits/playbook/pb_owner/docs/_owner_default.jsx +0 -10
- data/app/pb_kits/playbook/pb_owner/docs/example.yml +0 -9
- data/app/pb_kits/playbook/pb_owner/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_owner_phone/_owner_phone.html.erb +0 -7
- data/app/pb_kits/playbook/pb_owner_phone/_owner_phone.jsx +0 -21
- data/app/pb_kits/playbook/pb_owner_phone/docs/_owner_phone_default.html.erb +0 -6
- data/app/pb_kits/playbook/pb_owner_phone/docs/_owner_phone_default.jsx +0 -10
- data/app/pb_kits/playbook/pb_owner_phone/docs/example.yml +0 -9
- data/app/pb_kits/playbook/pb_owner_phone/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_owner_phone/owner_phone.rb +0 -62
- data/app/pb_kits/playbook/pb_phone/_phone.html.erb +0 -6
- data/app/pb_kits/playbook/pb_phone/_phone.jsx +0 -21
- data/app/pb_kits/playbook/pb_phone/docs/_phone_default.html.erb +0 -4
- data/app/pb_kits/playbook/pb_phone/docs/_phone_default.jsx +0 -10
- data/app/pb_kits/playbook/pb_phone/docs/example.yml +0 -9
- data/app/pb_kits/playbook/pb_phone/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone/phone.rb +0 -70
- data/fonts/fontawesome.js +0 -1978
- data/fonts/regular.js +0 -1217
@@ -0,0 +1,18 @@
|
|
1
|
+
<%= pb_rails("contact", props: {
|
2
|
+
contact_type: "cell",
|
3
|
+
contact_value: "349-185-9988",
|
4
|
+
}) %>
|
5
|
+
|
6
|
+
<%= pb_rails("contact", props: {
|
7
|
+
contact_value: 5555555555,
|
8
|
+
}) %>
|
9
|
+
|
10
|
+
<%= pb_rails("contact", props: {
|
11
|
+
contact_type: "email",
|
12
|
+
contact_value: "email@example.com",
|
13
|
+
}) %>
|
14
|
+
|
15
|
+
<%= pb_rails("contact", props: {
|
16
|
+
contact_type: "work",
|
17
|
+
contact_value: "3245627482",
|
18
|
+
}) %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import {Contact} from "../../"
|
3
|
+
|
4
|
+
function ContactDefault() {
|
5
|
+
return (
|
6
|
+
<div>
|
7
|
+
<Contact
|
8
|
+
contactType="cell"
|
9
|
+
contactValue="349-185-9988"
|
10
|
+
/>
|
11
|
+
<Contact
|
12
|
+
contactValue="5555555555"
|
13
|
+
/>
|
14
|
+
<Contact
|
15
|
+
contactType="email"
|
16
|
+
contactValue="email@example.com"
|
17
|
+
/>
|
18
|
+
<Contact
|
19
|
+
contactType="work"
|
20
|
+
contactValue="3245627482"
|
21
|
+
/>
|
22
|
+
</div>
|
23
|
+
)
|
24
|
+
}
|
25
|
+
|
26
|
+
export default ContactDefault
|
@@ -0,0 +1 @@
|
|
1
|
+
export {default as ContactDefault} from './_contact_default.jsx';
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import colors from "../tokens/_colors.scss"
|
2
2
|
import typography from "../tokens/_typography.scss";
|
3
3
|
|
4
|
-
const
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
const dataColors = [
|
5
|
+
colors.data_1,
|
6
|
+
colors.data_2,
|
7
|
+
colors.data_3,
|
8
|
+
colors.data_4,
|
9
|
+
colors.data_5,
|
10
|
+
colors.data_6,
|
11
|
+
colors.data_7,
|
12
|
+
colors.data_8,
|
13
|
+
]
|
14
14
|
|
15
|
+
const applyCustomSeriesColors = function(highchart) {
|
15
16
|
highchart.series.forEach(function(item, index) {
|
16
|
-
const selected_color =
|
17
|
+
const selected_color = dataColors[index];
|
17
18
|
item.color = selected_color;
|
18
|
-
|
19
19
|
item.data.forEach(function(data_item) {
|
20
20
|
if(data_item.color){
|
21
21
|
data_item.color = selected_color;
|
@@ -98,4 +98,7 @@ const commonSettings = function(highchart) {
|
|
98
98
|
styleLegend(highchart);
|
99
99
|
};
|
100
100
|
|
101
|
-
export
|
101
|
+
export {
|
102
|
+
commonSettings,
|
103
|
+
dataColors,
|
104
|
+
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
2
|
id: object.id,
|
3
3
|
data: object.data,
|
4
|
-
class: object.classname
|
4
|
+
class: object.classname) do %>
|
5
5
|
|
6
6
|
<%= link_to object.url do %>
|
7
|
-
<%= object.
|
7
|
+
<%= pb_rails("badge", props: { variant: "primary", text: object.hashtag_text }) %>
|
8
8
|
<% end %>
|
9
9
|
|
10
10
|
<% end %>
|
@@ -2,75 +2,36 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbHashtag
|
5
|
-
class Hashtag
|
6
|
-
|
7
|
-
configured_data
|
8
|
-
configured_id
|
9
|
-
configured_text
|
10
|
-
configured_type
|
11
|
-
configured_url].freeze
|
5
|
+
class Hashtag
|
6
|
+
include Playbook::Props
|
12
7
|
|
13
|
-
|
14
|
-
data: default_configuration,
|
15
|
-
id: default_configuration,
|
16
|
-
text: default_configuration,
|
17
|
-
type: default_configuration,
|
18
|
-
url: default_configuration)
|
19
|
-
self.configured_classname = classname
|
20
|
-
self.configured_data = data
|
21
|
-
self.configured_id = id
|
22
|
-
self.configured_text = text
|
23
|
-
self.configured_type = type
|
24
|
-
self.configured_url = url
|
25
|
-
end
|
26
|
-
|
27
|
-
def type
|
28
|
-
type_options = %w[default project home]
|
29
|
-
set_type = one_of_value(configured_type, type_options, "default")
|
30
|
-
if set_type === "home"
|
31
|
-
"H#"
|
32
|
-
elsif set_type === "project"
|
33
|
-
"P#"
|
34
|
-
else
|
35
|
-
"#"
|
36
|
-
end
|
37
|
-
end
|
8
|
+
partial "pb_hashtag/hashtag"
|
38
9
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
10
|
+
prop :text
|
11
|
+
prop :type, type: Playbook::Props::Enum,
|
12
|
+
values: %w[default project home],
|
13
|
+
default: "default"
|
14
|
+
prop :url
|
43
15
|
|
44
|
-
def
|
45
|
-
|
46
|
-
type + text
|
16
|
+
def classname
|
17
|
+
generate_classname("pb_hastag_kit")
|
47
18
|
end
|
48
19
|
|
49
|
-
def
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
def kit_class
|
54
|
-
kit_options = [
|
55
|
-
"pb_hashtag_kit",
|
56
|
-
type,
|
57
|
-
]
|
58
|
-
kit_options.join("_")
|
59
|
-
end
|
60
|
-
|
61
|
-
|
62
|
-
def to_partial_path
|
63
|
-
"pb_hashtag/hashtag"
|
20
|
+
def hashtag_text
|
21
|
+
type_text + text
|
64
22
|
end
|
65
23
|
|
66
24
|
private
|
67
25
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
26
|
+
def type_text
|
27
|
+
if type === "home"
|
28
|
+
"H#"
|
29
|
+
elsif type === "project"
|
30
|
+
"P#"
|
31
|
+
else
|
32
|
+
"#"
|
33
|
+
end
|
72
34
|
end
|
73
|
-
attr_accessor(*PROPS)
|
74
35
|
end
|
75
36
|
end
|
76
37
|
end
|
@@ -1,17 +1,17 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
2
|
id: object.id,
|
3
3
|
data: object.data,
|
4
|
-
class: object.classname
|
4
|
+
class: object.classname) do %>
|
5
5
|
|
6
6
|
<%= pb_rails "title", props: {
|
7
7
|
classname: "pb_home_address_street_address",
|
8
8
|
size: 4,
|
9
|
-
text:
|
9
|
+
text: object.address_house_style
|
10
10
|
} %>
|
11
11
|
|
12
12
|
<%= pb_rails "body", props: {
|
13
13
|
color: "light",
|
14
|
-
text:
|
14
|
+
text: object.city_state,
|
15
15
|
} %>
|
16
16
|
|
17
17
|
<%= pb_rails "body", props: { classname: "home-hashtag", tag: "span" } do %>
|
@@ -2,79 +2,36 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbHomeAddressStreet
|
5
|
-
class HomeAddressStreet
|
6
|
-
|
7
|
-
configured_city
|
8
|
-
configured_classname
|
9
|
-
configured_dark
|
10
|
-
configured_data
|
11
|
-
configured_home_id
|
12
|
-
configured_house_style
|
13
|
-
configured_id
|
14
|
-
configured_state
|
15
|
-
configured_zipcode].freeze
|
5
|
+
class HomeAddressStreet
|
6
|
+
include Playbook::Props
|
16
7
|
|
17
|
-
|
18
|
-
city: default_configuration,
|
19
|
-
classname: default_configuration,
|
20
|
-
dark: default_configuration,
|
21
|
-
data: default_configuration,
|
22
|
-
home_id: default_configuration,
|
23
|
-
house_style: default_configuration,
|
24
|
-
id: default_configuration,
|
25
|
-
state: default_configuration,
|
26
|
-
zipcode: default_configuration)
|
27
|
-
self.configured_address = address
|
28
|
-
self.configured_city = city
|
29
|
-
self.configured_classname = classname
|
30
|
-
self.configured_dark = dark
|
31
|
-
self.configured_data = data
|
32
|
-
self.configured_home_id = home_id
|
33
|
-
self.configured_house_style = house_style
|
34
|
-
self.configured_state = state
|
35
|
-
self.configured_zipcode = zipcode
|
36
|
-
end
|
37
|
-
|
38
|
-
def address
|
39
|
-
default_value(configured_address, "")
|
40
|
-
end
|
41
|
-
|
42
|
-
def city
|
43
|
-
default_value(configured_city, "")
|
44
|
-
end
|
8
|
+
partial "pb_home_address_street/home_address_street"
|
45
9
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
def house_style
|
55
|
-
default_value(configured_house_style, "")
|
56
|
-
end
|
10
|
+
prop :address
|
11
|
+
prop :city
|
12
|
+
prop :home_id, type: Playbook::Props::Number
|
13
|
+
prop :house_style
|
14
|
+
prop :state
|
15
|
+
prop :zipcode
|
16
|
+
prop :dark, type: Playbook::Props::Boolean, default: false
|
57
17
|
|
58
|
-
def
|
59
|
-
|
18
|
+
def classname
|
19
|
+
generate_classname("pb_home_address_street_kit", dark_class)
|
60
20
|
end
|
61
21
|
|
62
|
-
def
|
63
|
-
|
22
|
+
def city_state
|
23
|
+
"#{city}, #{state}"
|
64
24
|
end
|
65
25
|
|
66
|
-
def
|
67
|
-
"
|
26
|
+
def address_house_style
|
27
|
+
"#{address} \u00b7 #{house_style}"
|
68
28
|
end
|
69
29
|
|
70
30
|
private
|
71
31
|
|
72
|
-
|
73
|
-
|
74
|
-
def default_configuration
|
75
|
-
DEFAULT
|
32
|
+
def dark_class
|
33
|
+
dark ? "dark" : nil
|
76
34
|
end
|
77
|
-
attr_accessor(*PROPS)
|
78
35
|
end
|
79
36
|
end
|
80
37
|
end
|
@@ -31,12 +31,12 @@ class Input extends React.Component {
|
|
31
31
|
} = this.props
|
32
32
|
|
33
33
|
const css = classnames([
|
34
|
-
`
|
34
|
+
`pb_input_kit`,
|
35
35
|
className,
|
36
36
|
])
|
37
37
|
|
38
38
|
return (
|
39
|
-
<div className="
|
39
|
+
<div className="pb_input_kit">
|
40
40
|
<Caption text={label} />
|
41
41
|
<div className="input_wrapper">
|
42
42
|
<input className={css}
|
@@ -2,89 +2,20 @@
|
|
2
2
|
|
3
3
|
module Playbook
|
4
4
|
module PbInput
|
5
|
-
class Input
|
6
|
-
|
7
|
-
configured_classname
|
8
|
-
configured_data
|
9
|
-
configured_id
|
10
|
-
configured_name
|
11
|
-
configured_label
|
12
|
-
configured_placeholder
|
13
|
-
configured_type
|
14
|
-
configured_value].freeze
|
5
|
+
class Input
|
6
|
+
include Playbook::Props
|
15
7
|
|
16
|
-
|
17
|
-
classname: default_configuration,
|
18
|
-
data: default_configuration,
|
19
|
-
id: default_configuration,
|
20
|
-
name: default_configuration,
|
21
|
-
label: default_configuration,
|
22
|
-
placeholder: default_configuration,
|
23
|
-
type: default_configuration,
|
24
|
-
value: default_configuration)
|
25
|
-
self.configured_aria = aria
|
26
|
-
self.configured_classname = classname
|
27
|
-
self.configured_data = data
|
28
|
-
self.configured_id = id
|
29
|
-
self.configured_name = name
|
30
|
-
self.configured_label = label
|
31
|
-
self.configured_placeholder = placeholder
|
32
|
-
self.configured_type = type
|
33
|
-
self.configured_value = value
|
34
|
-
end
|
35
|
-
|
36
|
-
def label
|
37
|
-
if configured_label == default_configuration
|
38
|
-
""
|
39
|
-
else
|
40
|
-
configured_label
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def name
|
45
|
-
if configured_name == default_configuration
|
46
|
-
""
|
47
|
-
else
|
48
|
-
configured_name
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def placeholder
|
53
|
-
if configured_placeholder == default_configuration
|
54
|
-
""
|
55
|
-
else
|
56
|
-
configured_placeholder
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
def type
|
61
|
-
if configured_type == default_configuration
|
62
|
-
"text"
|
63
|
-
else
|
64
|
-
configured_type
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def value
|
69
|
-
if configured_value == default_configuration
|
70
|
-
""
|
71
|
-
else
|
72
|
-
configured_value
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
def to_partial_path
|
77
|
-
"pb_input/input"
|
78
|
-
end
|
8
|
+
partial "pb_input/input"
|
79
9
|
|
80
|
-
|
10
|
+
prop :label
|
11
|
+
prop :name
|
12
|
+
prop :placeholder
|
13
|
+
prop :value
|
14
|
+
prop :type, default: "text"
|
81
15
|
|
82
|
-
|
83
|
-
|
84
|
-
def default_configuration
|
85
|
-
DEFAULT
|
16
|
+
def classname
|
17
|
+
generate_classname("pb_input_kit")
|
86
18
|
end
|
87
|
-
attr_accessor(*PROPS)
|
88
19
|
end
|
89
20
|
end
|
90
21
|
end
|