playbook_ui 13.0.0.pre.alpha.PLAY966collapsiblenav41129 → 13.0.0.pre.alpha.salesbookmismatchingdate1120

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +1 -1
  3. data/app/pb_kits/playbook/pb_kit/dateTime.ts +55 -48
  4. data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +14 -16
  5. data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +115 -86
  6. data/app/pb_kits/playbook/pb_nav/_horizontal_nav.scss +58 -58
  7. data/app/pb_kits/playbook/pb_nav/_item.tsx +138 -234
  8. data/app/pb_kits/playbook/pb_nav/_mixins.scss +5 -0
  9. data/app/pb_kits/playbook/pb_nav/_nav.scss +0 -38
  10. data/app/pb_kits/playbook/pb_nav/_nav.tsx +1 -17
  11. data/app/pb_kits/playbook/pb_nav/_subtle_mixin.scss +11 -9
  12. data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +59 -50
  13. data/app/pb_kits/playbook/pb_nav/docs/_block_no_title_nav.jsx +1 -1
  14. data/app/pb_kits/playbook/pb_nav/docs/_borderless_nav.jsx +1 -4
  15. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.html.erb +4 -4
  16. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +10 -4
  17. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.jsx +1 -5
  18. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.html.erb +12 -12
  19. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.jsx +1 -13
  20. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.md +1 -1
  21. data/app/pb_kits/playbook/pb_nav/docs/_no_highlight_nav.jsx +1 -4
  22. data/app/pb_kits/playbook/pb_nav/docs/_subtle_nav.jsx +1 -4
  23. data/app/pb_kits/playbook/pb_nav/docs/_subtle_with_icons_nav.jsx +1 -4
  24. data/app/pb_kits/playbook/pb_nav/docs/example.yml +5 -5
  25. data/app/pb_kits/playbook/pb_nav/item.html.erb +12 -19
  26. data/app/pb_kits/playbook/pb_nav/item.rb +14 -55
  27. data/app/pb_kits/playbook/pb_nav/nav.html.erb +1 -3
  28. data/app/pb_kits/playbook/pb_time/_time.tsx +1 -1
  29. data/dist/playbook-rails.js +5 -5
  30. data/lib/playbook/version.rb +1 -1
  31. metadata +3 -4
  32. data/app/pb_kits/playbook/pb_nav/_collapsible_trail_mixin.scss +0 -14
  33. data/app/pb_kits/playbook/pb_nav/navTypes.ts +0 -25
@@ -22,72 +22,31 @@ module Playbook
22
22
  default: "_self"
23
23
  def classname
24
24
  if collapsible
25
- "#{generate_classname('pb_nav_list_kit_item', active_class)} #{generate_classname('pb_collapsible_nav_item', active_class, collapsible_trail_class)} #{font_size_class} #{font_weight_class} pb_nav_list_item_link_collapsible"
25
+ "#{generate_classname('pb_nav_list_kit_item', active_class)} #{generate_classname('pb_collapsible_nav_item', active_class, collapsible_trail_class)} #{font_size_class} #{font_weight_class}"
26
26
  else
27
- "#{generate_classname('pb_nav_list_kit_item', active_class)} #{font_size_class} #{font_weight_class} pb_nav_list_item_link"
27
+ "#{generate_classname('pb_nav_list_kit_item', active_class)} #{font_size_class} #{font_weight_class}"
28
28
  end
29
29
  end
30
30
 
31
- def spacing_props
32
- if collapsible
33
- if object.margin || object.margin_x || object.margin_y || object.margin_bottom || object.margin_top || object.margin_right || object.margin_left
34
- # Call the original method
35
- original_result = super
36
-
37
- # Remove p_value, px_value, py_value, etc. based on the object's properties
38
- margin_classes_to_remove = []
39
- margin_classes_to_remove << "m_#{object.margin}" if object.margin
40
- margin_classes_to_remove << "mx_#{object.margin_x}" if object.margin_x
41
- margin_classes_to_remove << "my_#{object.margin_y}" if object.margin_y
42
- margin_classes_to_remove << "mb_#{object.margin_bottom}" if object.margin_bottom
43
- margin_classes_to_remove << "mt_#{object.margin_top}" if object.margin_top
44
- margin_classes_to_remove << "mr_#{object.margin_right}" if object.margin_right
45
- margin_classes_to_remove << "ml_#{object.margin_left}" if object.margin_left
46
-
47
- margin_classes_to_remove.each do |class_to_remove|
48
- original_result.gsub!(class_to_remove, "")
49
- end
50
-
51
- original_result.strip
52
- else
53
- super
54
- end
55
- else
56
- super
57
- end
31
+ def tag
32
+ link ? "a" : "div"
58
33
  end
59
34
 
60
- def margin_classes
61
- margin_attributes = {
62
- margin: "m",
63
- margin_x: "mx",
64
- margin_y: "my",
65
- margin_bottom: "mb",
66
- margin_top: "mt",
67
- margin_right: "mr",
68
- margin_left: "ml",
69
- }
70
-
71
- # rubocop:disable Style/RedundantAssignment
72
- margin_classes = margin_attributes.map do |attr, class_prefix|
73
- # rubocop:enable Style/RedundantAssignment
74
- value = object.public_send(attr)
75
- " #{class_prefix}_#{value}" if value
76
- end.compact.join
77
-
78
- margin_classes
35
+ def options
36
+ {
37
+ class: collapsible ? "pb_nav_list_item_link_collapsible" : "pb_nav_list_item_link",
38
+ }.compact
79
39
  end
80
40
 
81
- def tag
82
- link ? "a" : "div"
41
+ def link_options
42
+ options.merge(
43
+ href: link,
44
+ target: target
45
+ )
83
46
  end
84
47
 
85
48
  def collapsible_icons
86
- icon_right.present? && icon_right
87
- end
88
-
89
- def collapsible_nav_classname
90
- "collapsible_nav_wrapper_#{active_class}_#{collapsible_trail_class}"
49
+ icon_right.present? ? icon_right : %w[plus minus]
91
50
  end
92
51
 
93
52
  private
@@ -10,7 +10,5 @@
10
10
  <% end %>
11
11
  <% end %>
12
12
  <% end %>
13
- <div class='pb_nav_wrapper'>
14
- <%= content.presence %>
15
- </div>
13
+ <ul><%= content.presence %></ul>
16
14
  <% end %>
@@ -68,7 +68,7 @@ const Time = (props: TimeProps) => {
68
68
  )
69
69
  )}
70
70
 
71
- <time dateTime={date.toString()}>
71
+ <time dateTime={date.toLocaleString()}>
72
72
  <span>
73
73
  {unstyled
74
74
  ? (