playbook_ui 2.8.6 → 2.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/packs/application.js +1 -3
- data/app/pb_kits/playbook/packs/examples.js +12 -0
- data/app/pb_kits/playbook/packs/kits.js +4 -0
- data/app/pb_kits/playbook/packs/pb_currency.js +4 -0
- data/app/pb_kits/playbook/packs/pb_image.js +0 -1
- data/app/pb_kits/playbook/packs/pb_section_separator.js +4 -0
- data/app/pb_kits/playbook/packs/pb_stat_change.js +4 -0
- data/app/pb_kits/playbook/packs/pb_stat_value.js +4 -0
- data/app/pb_kits/playbook/packs/site_styles/_kit_style_index.scss +4 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +43 -26
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.jsx +34 -5
- data/app/pb_kits/playbook/pb_card/card.rb +1 -1
- data/app/pb_kits/playbook/pb_currency/_currency.html.erb +13 -0
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +21 -0
- data/app/pb_kits/playbook/pb_currency/_currency.scss +40 -0
- data/app/pb_kits/playbook/pb_currency/currency.rb +100 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_large.html.erb +25 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_small.html.erb +25 -0
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_currency/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +2 -0
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.scss +2 -3
- data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.rb +5 -3
- data/app/pb_kits/playbook/pb_dashboard_value/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_date/_date.scss +0 -7
- data/app/pb_kits/playbook/pb_date/date.rb +11 -9
- data/app/pb_kits/playbook/pb_label_pill/label_pill.rb +17 -16
- data/app/pb_kits/playbook/pb_owner/owner.rb +17 -17
- data/app/pb_kits/playbook/pb_owner_phone/owner_phone.rb +21 -23
- data/app/pb_kits/playbook/pb_phone/phone.rb +17 -16
- data/app/pb_kits/playbook/{pb_dashboard_value/child_kits/_stat_label.html.erb → pb_section_separator/_section_separator.html.erb} +1 -1
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +21 -0
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +29 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_line.html.erb +1 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text.html.erb +1 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/index.js +1 -0
- data/app/pb_kits/playbook/{pb_dashboard_value/stat_label.rb → pb_section_separator/section_separator.rb} +11 -18
- data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +4 -4
- data/app/pb_kits/playbook/{pb_dashboard_value/child_kits → pb_stat_change}/_stat_change.html.erb +0 -0
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +21 -0
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.scss +2 -0
- data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_default.html.erb +18 -0
- data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_stat_change/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_stat_change/docs/index.js +1 -0
- data/app/pb_kits/playbook/{pb_dashboard_value → pb_stat_change}/stat_change.rb +2 -3
- data/app/pb_kits/playbook/{pb_dashboard_value/child_kits → pb_stat_value}/_stat_value.html.erb +0 -0
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.jsx +21 -0
- data/app/pb_kits/playbook/{pb_dashboard_value/child_kits → pb_stat_value}/_stat_value.scss +3 -1
- data/app/pb_kits/playbook/pb_stat_value/docs/_stat_value_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_stat_value/docs/_stat_value_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_stat_value/docs/_stat_value_unit.html.erb +1 -0
- data/app/pb_kits/playbook/pb_stat_value/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_stat_value/docs/index.js +1 -0
- data/app/pb_kits/playbook/{pb_dashboard_value → pb_stat_value}/stat_value.rb +2 -3
- data/app/pb_kits/playbook/pb_table/styles/_structure.scss +1 -1
- data/app/pb_kits/playbook/pb_time/time.rb +7 -7
- data/app/pb_kits/playbook/pb_title_count/title_count.rb +8 -4
- data/app/pb_kits/playbook/pb_toggle/toggle.rb +14 -13
- data/app/pb_kits/playbook/pb_user_badge/user_badge.rb +2 -2
- data/app/pb_kits/playbook/pb_vertical_nav/_vertical_nav.html.erb +1 -5
- data/app/pb_kits/playbook/pb_vertical_nav/docs/_block_no_title.html.erb +5 -0
- data/app/pb_kits/playbook/pb_vertical_nav/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_vertical_nav/vertical_nav.rb +15 -9
- data/app/pb_kits/playbook/plugins/pb_chart_plugin.js +2 -0
- data/app/pb_kits/playbook/vendor.js +6 -0
- data/app/views/layouts/playbook/application.html.slim +0 -1
- data/lib/generators/kit/templates/kit_jsx.erb.tt +30 -12
- data/lib/playbook/engine.rb +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +43 -11
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_change.html.erb +0 -15
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_label.html.erb +0 -19
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@import "../tokens/colors";
|
|
2
|
+
@import "../tokens/spacing";
|
|
3
|
+
@import "../pb_caption/caption";
|
|
4
|
+
|
|
5
|
+
[class^=pb_section_separator_kit] {
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
position: relative;
|
|
10
|
+
|
|
11
|
+
span {
|
|
12
|
+
display: inline-block;
|
|
13
|
+
padding: 0 $space_xs;
|
|
14
|
+
background: $bg_light;
|
|
15
|
+
position: relative;
|
|
16
|
+
z-index: 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&::after {
|
|
20
|
+
content: "";
|
|
21
|
+
height: 1px;
|
|
22
|
+
width: 100%;
|
|
23
|
+
background: $border_light;
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 50%;
|
|
26
|
+
left: 0;
|
|
27
|
+
z-index: 0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= pb_rails("section_separator") %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= pb_rails("section_separator", props: { text: "Title Separator" }) %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default as SectionSeparatorDefault} from './_section_separator_default.jsx';
|
|
@@ -1,43 +1,36 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Playbook
|
|
4
|
-
module
|
|
5
|
-
class
|
|
4
|
+
module PbSectionSeparator
|
|
5
|
+
class SectionSeparator < Playbook::PbKit::Base
|
|
6
6
|
PROPS = %i[configured_classname
|
|
7
7
|
configured_data
|
|
8
8
|
configured_id
|
|
9
|
-
|
|
9
|
+
configured_text].freeze
|
|
10
10
|
|
|
11
11
|
def initialize(classname: default_configuration,
|
|
12
12
|
data: default_configuration,
|
|
13
13
|
id: default_configuration,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
text: default_configuration)
|
|
16
15
|
self.configured_classname = classname
|
|
17
16
|
self.configured_data = data
|
|
18
17
|
self.configured_id = id
|
|
19
|
-
self.
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def label
|
|
23
|
-
default_value(configured_label, nil)
|
|
18
|
+
self.configured_text = text
|
|
24
19
|
end
|
|
25
20
|
|
|
26
|
-
def
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
end
|
|
31
|
-
ApplicationController.renderer.render(partial: pb_label, as: :object)
|
|
21
|
+
def text
|
|
22
|
+
if is_set? configured_text
|
|
23
|
+
pb_text = Playbook::PbCaption::Caption.new(text: configured_text)
|
|
24
|
+
ApplicationController.renderer.render(partial: pb_text, as: :object)
|
|
32
25
|
end
|
|
33
26
|
end
|
|
34
27
|
|
|
35
28
|
def kit_class
|
|
36
|
-
"
|
|
29
|
+
"pb_section_separator_kit"
|
|
37
30
|
end
|
|
38
31
|
|
|
39
32
|
def to_partial_path
|
|
40
|
-
"
|
|
33
|
+
"pb_section_separator/section_separator"
|
|
41
34
|
end
|
|
42
35
|
|
|
43
36
|
private
|
|
@@ -27,8 +27,8 @@ module Playbook
|
|
|
27
27
|
|
|
28
28
|
def rating
|
|
29
29
|
rating_options = []
|
|
30
|
-
(0..5).step(0.5) do |
|
|
31
|
-
rating_options.push strip_trailing_zero(
|
|
30
|
+
(0..5).step(0.5) do |number|
|
|
31
|
+
rating_options.push strip_trailing_zero(number)
|
|
32
32
|
end
|
|
33
33
|
one_of_value(configured_rating.to_s, rating_options, "0")
|
|
34
34
|
end
|
|
@@ -55,8 +55,8 @@ module Playbook
|
|
|
55
55
|
|
|
56
56
|
private
|
|
57
57
|
|
|
58
|
-
def strip_trailing_zero(
|
|
59
|
-
|
|
58
|
+
def strip_trailing_zero(number)
|
|
59
|
+
number.to_s.sub(/\.?0+$/, "")
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
DEFAULT = Object.new
|
data/app/pb_kits/playbook/{pb_dashboard_value/child_kits → pb_stat_change}/_stat_change.html.erb
RENAMED
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
const propTypes = {
|
|
5
|
+
className: PropTypes.string,
|
|
6
|
+
id: PropTypes.string
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
class StatChange extends React.Component {
|
|
10
|
+
render() {
|
|
11
|
+
return (
|
|
12
|
+
<div className="pb_stat_change">
|
|
13
|
+
<span>STAT CHANGE CONTENT</span>
|
|
14
|
+
</div>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
StatChange.propTypes = propTypes;
|
|
20
|
+
|
|
21
|
+
export default StatChange;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<%= pb_rails("stat_change", props: {
|
|
2
|
+
change: "increase",
|
|
3
|
+
value: "28.4%"
|
|
4
|
+
}) %>
|
|
5
|
+
|
|
6
|
+
<br>
|
|
7
|
+
|
|
8
|
+
<%= pb_rails("stat_change", props: {
|
|
9
|
+
change: "decrease",
|
|
10
|
+
value: "6.1%"
|
|
11
|
+
}) %>
|
|
12
|
+
|
|
13
|
+
<br>
|
|
14
|
+
|
|
15
|
+
<%= pb_rails("stat_change", props: {
|
|
16
|
+
change: "neutral",
|
|
17
|
+
value: "98%"
|
|
18
|
+
}) %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default as StatChangeDefault} from './_stat_change_default.jsx';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Playbook
|
|
4
|
-
module
|
|
4
|
+
module PbStatChange
|
|
5
5
|
class StatChange < Playbook::PbKit::Base
|
|
6
6
|
PROPS = %i[configured_change
|
|
7
7
|
configured_classname
|
|
@@ -14,7 +14,6 @@ module Playbook
|
|
|
14
14
|
data: default_configuration,
|
|
15
15
|
id: default_configuration,
|
|
16
16
|
value: default_configuration)
|
|
17
|
-
|
|
18
17
|
self.configured_change = change
|
|
19
18
|
self.configured_classname = classname
|
|
20
19
|
self.configured_data = data
|
|
@@ -77,7 +76,7 @@ module Playbook
|
|
|
77
76
|
end
|
|
78
77
|
|
|
79
78
|
def to_partial_path
|
|
80
|
-
"
|
|
79
|
+
"pb_stat_change/stat_change"
|
|
81
80
|
end
|
|
82
81
|
|
|
83
82
|
private
|
data/app/pb_kits/playbook/{pb_dashboard_value/child_kits → pb_stat_value}/_stat_value.html.erb
RENAMED
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
const propTypes = {
|
|
5
|
+
className: PropTypes.string,
|
|
6
|
+
id: PropTypes.string
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
class StatValue extends React.Component {
|
|
10
|
+
render() {
|
|
11
|
+
return (
|
|
12
|
+
<div className="pb_stat_value">
|
|
13
|
+
<span>STAT VALUE CONTENT</span>
|
|
14
|
+
</div>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
StatValue.propTypes = propTypes;
|
|
20
|
+
|
|
21
|
+
export default StatValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= pb_rails("stat_value", props: { value: 1048 }) %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= pb_rails("stat_value", props: { value: "5,294", unit: "appt" }) %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default as StatValueDefault} from './_stat_value_default.jsx';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Playbook
|
|
4
|
-
module
|
|
4
|
+
module PbStatValue
|
|
5
5
|
class StatValue < Playbook::PbKit::Base
|
|
6
6
|
PROPS = %i[configured_classname
|
|
7
7
|
configured_data
|
|
@@ -14,7 +14,6 @@ module Playbook
|
|
|
14
14
|
id: default_configuration,
|
|
15
15
|
unit: default_configuration,
|
|
16
16
|
value: default_configuration)
|
|
17
|
-
|
|
18
17
|
self.configured_classname = classname
|
|
19
18
|
self.configured_data = data
|
|
20
19
|
self.configured_id = id
|
|
@@ -47,7 +46,7 @@ module Playbook
|
|
|
47
46
|
end
|
|
48
47
|
|
|
49
48
|
def to_partial_path
|
|
50
|
-
"
|
|
49
|
+
"pb_stat_value/stat_value"
|
|
51
50
|
end
|
|
52
51
|
|
|
53
52
|
private
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
include ActionView::Helpers::TagHelper
|
|
4
|
-
include ActionView::Context
|
|
5
|
-
|
|
6
3
|
module Playbook
|
|
7
4
|
module PbTime
|
|
8
5
|
class Time < Playbook::PbKit::Base
|
|
6
|
+
include ActionView::Helpers::TagHelper
|
|
7
|
+
include ActionView::Context
|
|
8
|
+
|
|
9
9
|
PROPS = %i[configured_classname
|
|
10
10
|
configured_data
|
|
11
11
|
configured_id
|
|
@@ -49,13 +49,13 @@ module Playbook
|
|
|
49
49
|
convert_to_timestamp(configured_timestamp)
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
def convert_to_timestamp(
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
def convert_to_timestamp(time)
|
|
53
|
+
time.is_a?(String) ? DateTime.parse(time) : time
|
|
54
|
+
time.in_time_zone(timezone_value)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def format_time_string
|
|
58
|
-
|
|
58
|
+
"#{hour}:#{minutes}#{meridian}" if is_set? configured_timestamp
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
def hour
|
|
@@ -50,8 +50,12 @@ module Playbook
|
|
|
50
50
|
|
|
51
51
|
def count
|
|
52
52
|
if is_set? configured_count
|
|
53
|
-
value = configured_count.is_a?(Integer) || configured_count.is_a?(Float)
|
|
54
|
-
|
|
53
|
+
value = if configured_count.is_a?(Integer) || configured_count.is_a?(Float)
|
|
54
|
+
format_number(configured_count)
|
|
55
|
+
else
|
|
56
|
+
configured_count
|
|
57
|
+
end
|
|
58
|
+
|
|
55
59
|
pb_count = Playbook::PbBody::Body.new(color: "light") do
|
|
56
60
|
value.to_s
|
|
57
61
|
end
|
|
@@ -59,8 +63,8 @@ module Playbook
|
|
|
59
63
|
end
|
|
60
64
|
end
|
|
61
65
|
|
|
62
|
-
def format_number(
|
|
63
|
-
|
|
66
|
+
def format_number(number)
|
|
67
|
+
number.to_s.gsub(/(\d)(?=\d{3}+(?:\.|$))(\d{3}\..*)?/, '\1,\2')
|
|
64
68
|
end
|
|
65
69
|
|
|
66
70
|
def kit_class
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Playbook
|
|
2
4
|
module PbToggle
|
|
3
5
|
class Toggle < Playbook::PbKit::Base
|
|
4
|
-
PROPS = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
].freeze
|
|
6
|
+
PROPS = %i[configured_classname
|
|
7
|
+
configured_data
|
|
8
|
+
configured_id
|
|
9
|
+
configured_size
|
|
10
|
+
configured_checked].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(classname: default_configuration,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
data: default_configuration,
|
|
14
|
+
id: default_configuration,
|
|
15
|
+
size: default_configuration,
|
|
16
|
+
checked: default_configuration)
|
|
16
17
|
self.configured_classname = classname
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
self.configured_data = data
|
|
19
|
+
self.configured_id = id
|
|
19
20
|
self.configured_size = size
|
|
20
21
|
self.configured_checked = checked
|
|
21
22
|
end
|
|
@@ -37,7 +38,7 @@ module Playbook
|
|
|
37
38
|
toggle_options = [
|
|
38
39
|
"pb_toggle_kit",
|
|
39
40
|
size,
|
|
40
|
-
checked_class
|
|
41
|
+
checked_class,
|
|
41
42
|
]
|
|
42
43
|
toggle_options.join("_")
|
|
43
44
|
end
|