playbook_ui 13.2.0 → 13.4.0.pre.alpha.play961turnoffdeprecationwarnings1171

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -0
  3. data/app/pb_kits/playbook/pb_body/_body.scss +5 -0
  4. data/app/pb_kits/playbook/pb_body/_body.tsx +5 -2
  5. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +19 -0
  6. data/app/pb_kits/playbook/pb_body/body.rb +8 -1
  7. data/app/pb_kits/playbook/pb_button/button.html.erb +2 -2
  8. data/app/pb_kits/playbook/pb_button/button.rb +3 -0
  9. data/app/pb_kits/playbook/pb_caption/_caption.tsx +1 -1
  10. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +5 -1
  11. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -1
  12. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +1 -1
  13. data/app/pb_kits/playbook/pb_kit/dateTime.ts +54 -23
  14. data/app/pb_kits/playbook/pb_table/docs/_table_header.html.erb +54 -0
  15. data/app/pb_kits/playbook/pb_table/docs/_table_header.md +1 -0
  16. data/app/pb_kits/playbook/pb_table/docs/_table_two_actions.jsx +3 -3
  17. data/app/pb_kits/playbook/pb_table/docs/example.yml +1 -0
  18. data/app/pb_kits/playbook/pb_table/styles/_all.scss +1 -0
  19. data/app/pb_kits/playbook/pb_table/styles/_table_header.scss +31 -0
  20. data/app/pb_kits/playbook/pb_table/table_header.html.erb +64 -0
  21. data/app/pb_kits/playbook/pb_table/table_header.rb +53 -0
  22. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +1 -1
  23. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +14 -7
  24. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.html.erb +21 -0
  25. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.jsx +36 -0
  26. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.md +1 -0
  27. data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +3 -1
  28. data/app/pb_kits/playbook/pb_timestamp/docs/index.js +1 -0
  29. data/app/pb_kits/playbook/pb_timestamp/timestamp.html.erb +5 -1
  30. data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +3 -1
  31. data/app/pb_kits/playbook/pb_title/_title.scss +8 -4
  32. data/app/pb_kits/playbook/pb_title/_title.tsx +5 -2
  33. data/app/pb_kits/playbook/pb_title/_title_mixin.scss +19 -0
  34. data/app/pb_kits/playbook/pb_title/title.rb +9 -2
  35. data/app/pb_kits/playbook/tokens/_spacing.scss +1 -1
  36. data/app/pb_kits/playbook/tokens/_text_align.scss +18 -0
  37. data/app/pb_kits/playbook/utilities/_hover.scss +4 -0
  38. data/app/pb_kits/playbook/utilities/_max_width.scss +4 -0
  39. data/app/pb_kits/playbook/utilities/_spacing.scss +92 -49
  40. data/app/pb_kits/playbook/utilities/_text_align.scss +3 -0
  41. data/app/pb_kits/playbook/utilities/globalProps.ts +37 -9
  42. data/dist/playbook-rails.js +5 -5
  43. data/lib/playbook/classnames.rb +1 -0
  44. data/lib/playbook/hover.rb +6 -2
  45. data/lib/playbook/kit_base.rb +2 -0
  46. data/lib/playbook/props/base.rb +1 -1
  47. data/lib/playbook/spacing.rb +13 -4
  48. data/lib/playbook/text_align.rb +37 -0
  49. data/lib/playbook/version.rb +2 -2
  50. metadata +18 -7
@@ -34,6 +34,7 @@ module Playbook
34
34
  position_props,
35
35
  hover_props,
36
36
  border_radius_props,
37
+ text_align_props,
37
38
  ].compact.join(" ")
38
39
  end
39
40
 
@@ -24,12 +24,16 @@ module Playbook
24
24
  []
25
25
  end
26
26
 
27
+ def hover_color_values
28
+ []
29
+ end
30
+
27
31
  def hover_values
28
32
  hover_options.keys.select { |sk| try(sk) }
29
33
  end
30
34
 
31
35
  def hover_attributes
32
- %w[background shadow scale]
36
+ %w[background shadow scale color]
33
37
  end
34
38
 
35
39
  def hover_props
@@ -43,7 +47,7 @@ module Playbook
43
47
  prefix = hover_options[prop]
44
48
  if responsive
45
49
  value.each do |key, val|
46
- if key == :background
50
+ if %i[background color].include?(key)
47
51
  css += "#{prefix}_#{key}_#{val} " if hover_attributes.include?(key.to_s)
48
52
  elsif hover_attributes.include?(key.to_s) && send("hover_#{key}_values").include?(val.to_s)
49
53
  css += "#{prefix}_#{key}_#{val} "
@@ -22,6 +22,7 @@ require "playbook/order"
22
22
  require "playbook/position"
23
23
  require "playbook/hover"
24
24
  require "playbook/border_radius"
25
+ require "playbook/text_align"
25
26
 
26
27
  module Playbook
27
28
  class KitBase < ViewComponent::Base
@@ -49,6 +50,7 @@ module Playbook
49
50
  include Playbook::Position
50
51
  include Playbook::Hover
51
52
  include Playbook::BorderRadius
53
+ include Playbook::TextAlign
52
54
 
53
55
  prop :id
54
56
  prop :data, type: Playbook::Props::Hash, default: {}
@@ -20,7 +20,7 @@ module Playbook
20
20
  end
21
21
 
22
22
  def validate!(input_value)
23
- warn("#{kit} Kit: The prop '#{name}' is deprecated and will be removed in a future release!") if deprecated && input_value # TODO: add some color for pop
23
+ # warn("#{kit} Kit: The prop '#{name}' is deprecated and will be removed in a future release!") if deprecated && input_value # TODO: add some color for pop
24
24
 
25
25
  raise(Playbook::Props::Error, "#{kit} prop '#{name}' of type #{inspect.class} is required and needs a value") if required && input_value.nil?
26
26
 
@@ -27,7 +27,7 @@ module Playbook
27
27
  end
28
28
 
29
29
  def max_width_values
30
- %w[xs sm md lg xl 0 none]
30
+ %w[xs sm md lg xl xxl 0 none]
31
31
  end
32
32
 
33
33
  def spacing_options
@@ -54,22 +54,31 @@ module Playbook
54
54
  end
55
55
 
56
56
  def screen_size_values
57
- %w[xs sm md lg xl]
57
+ %w[xs sm md lg xl default]
58
+ end
59
+
60
+ def break_method_values
61
+ %w[on at]
58
62
  end
59
63
 
60
64
  def spacing_props
61
65
  selected_props = spacing_options.keys.select { |sk| try(sk) }
62
66
  return nil unless selected_props.present?
63
67
 
64
- responsive = selected_props.present? && try(selected_props.first).is_a?(::Hash)
65
68
  css = ""
66
69
  selected_props.each do |prop|
70
+ responsive = try(prop).is_a?(::Hash)
67
71
  spacing_value = send(prop)
68
72
  prefix = spacing_options[prop]
73
+
69
74
  if responsive
75
+ default_value = spacing_value.delete(:default) || nil
76
+ break_value = spacing_value.delete(:break) || break_method_values.first
70
77
  spacing_value.each do |key, value|
71
- css += "#{prefix}_#{key}_#{value} " if screen_size_values.include?(key.to_s) && spacing_values.include?(value.to_s)
78
+ css += "break_#{break_value}_#{key}\:#{prefix}_#{value} " if screen_size_values.include?(key.to_s) && spacing_values.include?(value.to_s)
72
79
  end
80
+
81
+ css += "#{prefix}_#{default_value} " if spacing_values.include?(default_value)
73
82
  elsif spacing_values.include?(spacing_value)
74
83
  css += "#{prefix}_#{spacing_value} "
75
84
  end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module TextAlign
5
+ def self.included(base)
6
+ base.prop :text_align
7
+ end
8
+
9
+ # rubocop:disable Style/IfInsideElse
10
+ def text_align_props
11
+ selected_props = text_align_options.keys.select { |sk| try(sk) }
12
+ return nil unless selected_props.present?
13
+
14
+ selected_props.map do |k|
15
+ text_align_value = send(k)
16
+ if text_align_value.is_a?(Hash)
17
+ text_align_value.map do |media_size, flex_value|
18
+ "text_align_#{media_size}_#{flex_value.underscore}" if text_align_values.include? flex_value
19
+ end
20
+ else
21
+ "text_align_#{text_align_value.underscore}" if text_align_values.include? text_align_value
22
+ end
23
+ end.compact.join(" ")
24
+ end
25
+ # rubocop:enable Style/IfInsideElse
26
+
27
+ def text_align_options
28
+ {
29
+ text_align: "text_align",
30
+ }
31
+ end
32
+
33
+ def text_align_values
34
+ %w[start end left right center justify justify-all match-parent]
35
+ end
36
+ end
37
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "13.1.0"
5
- VERSION = "13.2.0"
4
+ PREVIOUS_VERSION = "13.4.0"
5
+ VERSION = "13.4.0.pre.alpha.play961turnoffdeprecationwarnings1171"
6
6
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.2.0
4
+ version: 13.4.0.pre.alpha.play961turnoffdeprecationwarnings1171
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
8
8
  - Power Devs
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-09-01 00:00:00.000000000 Z
12
+ date: 2023-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -2057,6 +2057,8 @@ files:
2057
2057
  - app/pb_kits/playbook/pb_table/docs/_table_data_table.md
2058
2058
  - app/pb_kits/playbook/pb_table/docs/_table_disable_hover.html.erb
2059
2059
  - app/pb_kits/playbook/pb_table/docs/_table_disable_hover.jsx
2060
+ - app/pb_kits/playbook/pb_table/docs/_table_header.html.erb
2061
+ - app/pb_kits/playbook/pb_table/docs/_table_header.md
2060
2062
  - app/pb_kits/playbook/pb_table/docs/_table_icon_buttons.html.erb
2061
2063
  - app/pb_kits/playbook/pb_table/docs/_table_icon_buttons.jsx
2062
2064
  - app/pb_kits/playbook/pb_table/docs/_table_icon_buttons.md
@@ -2112,12 +2114,15 @@ files:
2112
2114
  - app/pb_kits/playbook/pb_table/styles/_structure.scss
2113
2115
  - app/pb_kits/playbook/pb_table/styles/_table-card.scss
2114
2116
  - app/pb_kits/playbook/pb_table/styles/_table-dark.scss
2117
+ - app/pb_kits/playbook/pb_table/styles/_table_header.scss
2115
2118
  - app/pb_kits/playbook/pb_table/styles/_tablet_collapse.scss
2116
2119
  - app/pb_kits/playbook/pb_table/styles/_variables.scss
2117
2120
  - app/pb_kits/playbook/pb_table/styles/_vertical_border.scss
2118
2121
  - app/pb_kits/playbook/pb_table/table.html.erb
2119
2122
  - app/pb_kits/playbook/pb_table/table.rb
2120
2123
  - app/pb_kits/playbook/pb_table/table.test.js
2124
+ - app/pb_kits/playbook/pb_table/table_header.html.erb
2125
+ - app/pb_kits/playbook/pb_table/table_header.rb
2121
2126
  - app/pb_kits/playbook/pb_table/table_row.html.erb
2122
2127
  - app/pb_kits/playbook/pb_table/table_row.rb
2123
2128
  - app/pb_kits/playbook/pb_text_input/_text_input.scss
@@ -2249,6 +2254,9 @@ files:
2249
2254
  - app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.html.erb
2250
2255
  - app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.jsx
2251
2256
  - app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones_swift.md
2257
+ - app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.html.erb
2258
+ - app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.jsx
2259
+ - app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.md
2252
2260
  - app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.html.erb
2253
2261
  - app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.jsx
2254
2262
  - app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_swift.md
@@ -2493,6 +2501,7 @@ files:
2493
2501
  - app/pb_kits/playbook/tokens/_screen_sizes.scss
2494
2502
  - app/pb_kits/playbook/tokens/_shadows.scss
2495
2503
  - app/pb_kits/playbook/tokens/_spacing.scss
2504
+ - app/pb_kits/playbook/tokens/_text_align.scss
2496
2505
  - app/pb_kits/playbook/tokens/_titles.scss
2497
2506
  - app/pb_kits/playbook/tokens/_transition.scss
2498
2507
  - app/pb_kits/playbook/tokens/_typography.scss
@@ -2522,6 +2531,7 @@ files:
2522
2531
  - app/pb_kits/playbook/utilities/_positioning.scss
2523
2532
  - app/pb_kits/playbook/utilities/_shadow.scss
2524
2533
  - app/pb_kits/playbook/utilities/_spacing.scss
2534
+ - app/pb_kits/playbook/utilities/_text_align.scss
2525
2535
  - app/pb_kits/playbook/utilities/flexbox_global_props/_align_content.scss
2526
2536
  - app/pb_kits/playbook/utilities/flexbox_global_props/_align_items.scss
2527
2537
  - app/pb_kits/playbook/utilities/flexbox_global_props/_align_self.scss
@@ -2608,6 +2618,7 @@ files:
2608
2618
  - lib/playbook/props/string.rb
2609
2619
  - lib/playbook/shadow.rb
2610
2620
  - lib/playbook/spacing.rb
2621
+ - lib/playbook/text_align.rb
2611
2622
  - lib/playbook/version.rb
2612
2623
  - lib/playbook/z_index.rb
2613
2624
  - lib/playbook_ui.rb
@@ -2615,7 +2626,7 @@ homepage: https://playbook.powerapp.cloud/
2615
2626
  licenses:
2616
2627
  - ISC
2617
2628
  metadata: {}
2618
- post_install_message:
2629
+ post_install_message:
2619
2630
  rdoc_options: []
2620
2631
  require_paths:
2621
2632
  - lib
@@ -2626,12 +2637,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
2626
2637
  version: '0'
2627
2638
  required_rubygems_version: !ruby/object:Gem::Requirement
2628
2639
  requirements:
2629
- - - ">="
2640
+ - - ">"
2630
2641
  - !ruby/object:Gem::Version
2631
- version: '0'
2642
+ version: 1.3.1
2632
2643
  requirements: []
2633
2644
  rubygems_version: 3.3.7
2634
- signing_key:
2645
+ signing_key:
2635
2646
  specification_version: 4
2636
2647
  summary: Playbook Design System
2637
2648
  test_files: []