playbook_ui 2.9.6 → 2.9.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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_avatar/_avatar.html.erb +1 -1
  3. data/app/pb_kits/playbook/pb_avatar/avatar.rb +1 -1
  4. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.html.erb +5 -5
  5. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_status.html.erb +4 -4
  6. data/app/pb_kits/playbook/pb_button/_button.html.erb +3 -21
  7. data/app/pb_kits/playbook/pb_button/button.rb +47 -124
  8. data/app/pb_kits/playbook/pb_caption/caption.rb +1 -1
  9. data/app/pb_kits/playbook/pb_contact/_contact.html.erb +1 -1
  10. data/app/pb_kits/playbook/pb_contact/_contact.jsx +18 -8
  11. data/app/pb_kits/playbook/pb_contact/contact.rb +11 -2
  12. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +4 -1
  13. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +3 -0
  14. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.html.erb +12 -4
  15. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +2 -4
  16. data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.rb +13 -70
  17. data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_align.html.erb +6 -6
  18. data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_align.jsx +6 -6
  19. data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_default.html.erb +6 -6
  20. data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_default.jsx +6 -6
  21. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.html.erb +3 -3
  22. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb +12 -33
  23. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.html.erb +4 -2
  24. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_modified.html.erb +0 -1
  25. data/app/pb_kits/playbook/pb_layout/_body.html.erb +2 -2
  26. data/app/pb_kits/playbook/pb_layout/_layout.html.erb +2 -2
  27. data/app/pb_kits/playbook/pb_layout/_sidebar.html.erb +2 -2
  28. data/app/pb_kits/playbook/pb_layout/body.rb +5 -29
  29. data/app/pb_kits/playbook/pb_layout/layout.rb +31 -76
  30. data/app/pb_kits/playbook/pb_layout/sidebar.rb +5 -29
  31. data/app/pb_kits/playbook/pb_list/_item.html.erb +1 -1
  32. data/app/pb_kits/playbook/pb_list/_list.html.erb +3 -4
  33. data/app/pb_kits/playbook/pb_list/item.rb +5 -29
  34. data/app/pb_kits/playbook/pb_list/list.rb +41 -90
  35. data/app/pb_kits/playbook/pb_message/_message.html.erb +18 -5
  36. data/app/pb_kits/playbook/pb_message/docs/_message_default.html.erb +10 -20
  37. data/app/pb_kits/playbook/pb_message/message.rb +15 -72
  38. data/app/pb_kits/playbook/pb_person_contact/_person_contact.html.erb +1 -0
  39. data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +2 -1
  40. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_default.html.erb +4 -1
  41. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_default.jsx +4 -1
  42. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_single_person.html.erb +4 -1
  43. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_single_person.jsx +4 -1
  44. data/app/pb_kits/playbook/pb_section_separator/_section_separator.html.erb +2 -2
  45. data/app/pb_kits/playbook/pb_section_separator/section_separator.rb +6 -35
  46. data/app/pb_kits/playbook/pb_star_rating/_star_rating.html.erb +11 -11
  47. data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +5 -5
  48. data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +9 -51
  49. data/app/pb_kits/playbook/pb_stat_change/_stat_change.html.erb +5 -2
  50. data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +1 -1
  51. data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_default.html.erb +3 -3
  52. data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_default.jsx +3 -3
  53. data/app/pb_kits/playbook/pb_stat_change/stat_change.rb +10 -60
  54. data/app/pb_kits/playbook/pb_timestamp/_timestamp.html.erb +2 -2
  55. data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +6 -39
  56. data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +1 -1
  57. data/app/pb_kits/playbook/pb_user/_user.html.erb +13 -4
  58. data/app/pb_kits/playbook/pb_user/docs/_user_default.html.erb +3 -6
  59. data/app/pb_kits/playbook/pb_user/docs/_user_size.html.erb +3 -6
  60. data/app/pb_kits/playbook/pb_user/docs/_user_vertical_size.html.erb +3 -6
  61. data/app/pb_kits/playbook/pb_user/user.rb +23 -95
  62. data/app/pb_kits/playbook/pb_user_badge/_user_badge.html.erb +1 -1
  63. data/app/pb_kits/playbook/pb_user_badge/user_badge.rb +13 -49
  64. data/app/pb_kits/playbook/pb_vertical_nav/_item.html.erb +4 -2
  65. data/app/pb_kits/playbook/pb_vertical_nav/_vertical_nav.html.erb +9 -5
  66. data/app/pb_kits/playbook/pb_vertical_nav/item.rb +10 -49
  67. data/app/pb_kits/playbook/pb_vertical_nav/vertical_nav.rb +7 -58
  68. data/app/pb_kits/playbook/props.rb +1 -0
  69. data/app/pb_kits/playbook/props/date.rb +11 -0
  70. data/lib/playbook/version.rb +1 -1
  71. metadata +3 -2
@@ -1,7 +1,7 @@
1
1
  <%= content_tag(:div,
2
2
  id: object.id,
3
3
  data: object.data,
4
- class: object.classname(object.kit_class)) do %>
4
+ class: object.classname) do %>
5
5
  <%= content_tag(:div, class: "pb__user_badge_wrapper") do %>
6
6
  <%= render partial: object.display_badge %>
7
7
  <% end %>
@@ -2,61 +2,25 @@
2
2
 
3
3
  module Playbook
4
4
  module PbUserBadge
5
- class UserBadge < Playbook::PbKit::Base
6
- include ActionView::Helpers::AssetTagHelper
5
+ class UserBadge
6
+ include Playbook::Props
7
7
 
8
- PROPS = %i[configured_badge
9
- configured_classname
10
- configured_data
11
- configured_id
12
- configured_size].freeze
8
+ partial "pb_user_badge/user_badge"
13
9
 
14
- def initialize(badge: default_configuration,
15
- classname: default_configuration,
16
- data: default_configuration,
17
- id: default_configuration,
18
- size: default_configuration)
19
- self.configured_badge = badge
20
- self.configured_classname = classname
21
- self.configured_data = data
22
- self.configured_id = id
23
- self.configured_size = size
24
- end
25
-
26
- def display_badge
27
- "pb_user_badge/badges/#{badge}" if is_set? configured_badge
28
- end
29
-
30
- def kit_class
31
- kit_options = [
32
- "pb_user_badge_kit",
33
- size,
34
- ]
35
- kit_options.join("_")
36
- end
10
+ prop :badge, type: Playbook::Props::Enum,
11
+ values: %w[million-dollar veteran],
12
+ default: "million-dollar"
13
+ prop :size, type: Playbook::Props::Enum,
14
+ values: %w[sm md lg],
15
+ default: "md"
37
16
 
38
- def to_partial_path
39
- "pb_user_badge/user_badge"
17
+ def classname
18
+ generate_classname("pb_user_badge_kit", size)
40
19
  end
41
20
 
42
- private
43
-
44
- def badge
45
- badge_options = %w[million-dollar veteran]
46
- one_of_value(configured_badge, badge_options, "million-dollar")
47
- end
48
-
49
- def size
50
- size_options = %w[sm md lg]
51
- one_of_value(configured_size, size_options, "md")
52
- end
53
-
54
- DEFAULT = Object.new
55
- private_constant :DEFAULT
56
- def default_configuration
57
- DEFAULT
21
+ def display_badge
22
+ "pb_user_badge/badges/#{badge}"
58
23
  end
59
- attr_accessor(*PROPS)
60
24
  end
61
25
  end
62
26
  end
@@ -1,8 +1,10 @@
1
1
  <%= content_tag(:li,
2
2
  id: object.id,
3
3
  data: object.data,
4
- class: object.classname("vertical_nav_list_border_item#{object.active_class}")) do %>
4
+ class: object.classname) do %>
5
5
  <a href=<%= object.link %> class="vertical_nav_list_item_link">
6
- <span class="vertical_nav_list_item_link_text"><%= object.text %><%= object.yield(context: self) %></span>
6
+ <span class="vertical_nav_list_item_link_text">
7
+ <%= object.text %><%= capture(&object.children) if !object.children.nil? %>
8
+ </span>
7
9
  </a>
8
10
  <% end %>
@@ -1,9 +1,13 @@
1
1
  <%= content_tag(:div,
2
2
  id: object.id,
3
3
  data: object.data,
4
- class: object.classname("vertical_nav_list")) do %>
5
- <%= object.title %>
6
- <ul>
7
- <%= object.yield(context: self) %>
8
- </ul>
4
+ class: object.classname) do %>
5
+ <% if object.title %>
6
+ <%= content_tag(:div, class: "vertical_nav_list_title") do %>
7
+ <%= content_tag(:a, class: "vertical_nav_list_item_link_text", href: object.link) do %>
8
+ <%= pb_rails("caption", props: { text: object.title }) %>
9
+ <% end %>
10
+ <% end %>
11
+ <% end %>
12
+ <ul><%= capture(&object.children) %></ul>
9
13
  <% end %>
@@ -2,63 +2,24 @@
2
2
 
3
3
  module Playbook
4
4
  module PbVerticalNav
5
- class Item < Playbook::PbKit::Base
6
- PROPS = %i[configured_active
7
- configured_classname
8
- configured_data
9
- configured_id
10
- configured_link
11
- configured_text
12
- block].freeze
5
+ class Item
6
+ include Playbook::Props
13
7
 
14
- def initialize(active: default_configuration,
15
- classname: default_configuration,
16
- data: default_configuration,
17
- id: default_configuration,
18
- link: default_configuration,
19
- text: default_configuration,
20
- &block)
21
- self.configured_active = active
22
- self.configured_classname = classname
23
- self.configured_data = data
24
- self.configured_id = id
25
- self.configured_link = link
26
- self.configured_text = text
27
- self.block = block_given? ? block : nil
28
- end
29
-
30
- def active
31
- is_true? configured_active
32
- end
33
-
34
- def active_class
35
- "_active" if active == true
36
- end
8
+ partial "pb_vertical_nav/item"
37
9
 
38
- def text
39
- default_value(configured_text, "")
40
- end
41
-
42
- def link
43
- default_value(configured_link, "#")
44
- end
10
+ prop :active, type: Playbook::Props::Boolean, default: false
11
+ prop :link, default: "#"
12
+ prop :text
45
13
 
46
- def yield(context:)
47
- !block.nil? ? context.capture(&block) : ""
48
- end
49
-
50
- def to_partial_path
51
- "pb_vertical_nav/item"
14
+ def classname
15
+ generate_classname("vertical_nav_list_border_item", active_class)
52
16
  end
53
17
 
54
18
  private
55
19
 
56
- DEFAULT = Object.new
57
- private_constant :DEFAULT
58
- def default_configuration
59
- DEFAULT
20
+ def active_class
21
+ active ? "active" : nil
60
22
  end
61
- attr_accessor(*PROPS)
62
23
  end
63
24
  end
64
25
  end
@@ -2,69 +2,18 @@
2
2
 
3
3
  module Playbook
4
4
  module PbVerticalNav
5
- class VerticalNav < Playbook::PbKit::Base
5
+ class VerticalNav
6
6
  include ActionView::Helpers::TagHelper
7
- include ActionView::Context
7
+ include Playbook::Props
8
8
 
9
- PROPS = %i[configured_aria
10
- configured_classname
11
- configured_data
12
- configured_id
13
- configured_link
14
- configured_title
15
- block].freeze
9
+ partial "pb_vertical_nav/vertical_nav"
16
10
 
17
- def initialize(aria: default_configuration,
18
- classname: default_configuration,
19
- data: default_configuration,
20
- id: default_configuration,
21
- link: default_configuration,
22
- title: default_configuration,
23
- &block)
24
- self.configured_aria = aria
25
- self.configured_classname = classname
26
- self.configured_data = data
27
- self.configured_id = id
28
- self.configured_link = link
29
- self.configured_title = title
30
- self.block = block_given? ? block : nil
31
- end
32
-
33
- def title_text
34
- pb_title = Playbook::PbCaption::Caption.new(text: configured_title)
35
- ApplicationController.renderer.render(partial: pb_title, as: :object)
36
- end
37
-
38
- def title
39
- if is_set? configured_title
40
- content_tag(:div, class: "vertical_nav_list_title") do
41
- content_tag(:a, class: "vertical_nav_list_item_link_text", href: link) do
42
- title_text
43
- end
44
- end
45
- end
46
- end
47
-
48
- def link
49
- default_value(configured_link, "#")
50
- end
51
-
52
- def yield(context:)
53
- context.capture(&block)
54
- end
55
-
56
- def to_partial_path
57
- "pb_vertical_nav/vertical_nav"
58
- end
59
-
60
- private
11
+ prop :link, default: "#"
12
+ prop :title
61
13
 
62
- DEFAULT = Object.new
63
- private_constant :DEFAULT
64
- def default_configuration
65
- DEFAULT
14
+ def classname
15
+ generate_classname("vertical_nav_list")
66
16
  end
67
- attr_accessor(*PROPS)
68
17
  end
69
18
  end
70
19
  end
@@ -7,6 +7,7 @@ require_relative "./props/base"
7
7
 
8
8
  require_relative "./props/array"
9
9
  require_relative "./props/boolean"
10
+ require_relative "./props/date"
10
11
  require_relative "./props/enum"
11
12
  require_relative "./props/hash"
12
13
  require_relative "./props/hash_array"
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module Props
5
+ class Date < Playbook::Props::Base
6
+ def validate(value)
7
+ value.is_a?(::Date)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- VERSION = "2.9.6"
4
+ VERSION = "2.9.7"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.6
4
+ version: 2.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-10-31 00:00:00.000000000 Z
12
+ date: 2019-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -1026,6 +1026,7 @@ files:
1026
1026
  - app/pb_kits/playbook/props/array.rb
1027
1027
  - app/pb_kits/playbook/props/base.rb
1028
1028
  - app/pb_kits/playbook/props/boolean.rb
1029
+ - app/pb_kits/playbook/props/date.rb
1029
1030
  - app/pb_kits/playbook/props/enum.rb
1030
1031
  - app/pb_kits/playbook/props/hash.rb
1031
1032
  - app/pb_kits/playbook/props/hash_array.rb