playbook_ui 13.3.0 → 13.4.0.pre.alpha.PLAY973Hash1181
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +1 -0
- data/app/pb_kits/playbook/pb_button/button.html.erb +2 -2
- data/app/pb_kits/playbook/pb_button/button.rb +3 -0
- data/app/pb_kits/playbook/pb_card/card.rb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +1 -1
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +5 -1
- data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.rb +2 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +2 -2
- data/app/pb_kits/playbook/pb_file_upload/file_upload.rb +1 -1
- data/app/pb_kits/playbook/pb_kit/dateTime.ts +54 -23
- data/app/pb_kits/playbook/pb_passphrase/passphrase.rb +1 -1
- data/app/pb_kits/playbook/pb_radio/radio.rb +1 -1
- data/app/pb_kits/playbook/pb_select/select.rb +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +1 -1
- data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.rb +1 -1
- data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +1 -1
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +1 -1
- data/app/pb_kits/playbook/pb_source/source.rb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_two_actions.jsx +3 -3
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -2
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +14 -7
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.html.erb +21 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.jsx +36 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.md +1 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_timestamp/timestamp.html.erb +5 -1
- data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +3 -1
- data/app/pb_kits/playbook/pb_title/_title.scss +3 -4
- data/app/pb_kits/playbook/pb_toggle/toggle.rb +1 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -1
- data/app/pb_kits/playbook/tokens/_spacing.scss +1 -1
- data/app/pb_kits/playbook/tokens/_text_align.scss +18 -0
- data/app/pb_kits/playbook/utilities/_hover.scss +4 -0
- data/app/pb_kits/playbook/utilities/_max_width.scss +4 -0
- data/app/pb_kits/playbook/utilities/_spacing.scss +92 -49
- data/app/pb_kits/playbook/utilities/_text_align.scss +3 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +30 -2
- data/dist/playbook-rails.js +5 -5
- data/lib/playbook/classnames.rb +1 -0
- data/lib/playbook/hover.rb +6 -2
- data/lib/playbook/kit_base.rb +4 -2
- data/lib/playbook/props/hash.rb +1 -1
- data/lib/playbook/spacing.rb +13 -4
- data/lib/playbook/text_align.rb +37 -0
- data/lib/playbook/version.rb +2 -2
- metadata +13 -7
data/lib/playbook/classnames.rb
CHANGED
data/lib/playbook/hover.rb
CHANGED
@@ -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
|
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} "
|
data/lib/playbook/kit_base.rb
CHANGED
@@ -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,10 +50,11 @@ 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
|
-
prop :data, type: Playbook::Props::
|
55
|
-
prop :aria, type: Playbook::Props::
|
56
|
+
prop :data, type: Playbook::Props::HashProp, default: {}
|
57
|
+
prop :aria, type: Playbook::Props::HashProp, default: {}
|
56
58
|
prop :children, type: Playbook::Props::Proc
|
57
59
|
|
58
60
|
def object
|
data/lib/playbook/props/hash.rb
CHANGED
data/lib/playbook/spacing.rb
CHANGED
@@ -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 += "#{
|
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
|
data/lib/playbook/version.rb
CHANGED
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.
|
4
|
+
version: 13.4.0.pre.alpha.PLAY973Hash1181
|
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-
|
12
|
+
date: 2023-09-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -2254,6 +2254,9 @@ files:
|
|
2254
2254
|
- app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.html.erb
|
2255
2255
|
- app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.jsx
|
2256
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
|
2257
2260
|
- app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.html.erb
|
2258
2261
|
- app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.jsx
|
2259
2262
|
- app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_swift.md
|
@@ -2498,6 +2501,7 @@ files:
|
|
2498
2501
|
- app/pb_kits/playbook/tokens/_screen_sizes.scss
|
2499
2502
|
- app/pb_kits/playbook/tokens/_shadows.scss
|
2500
2503
|
- app/pb_kits/playbook/tokens/_spacing.scss
|
2504
|
+
- app/pb_kits/playbook/tokens/_text_align.scss
|
2501
2505
|
- app/pb_kits/playbook/tokens/_titles.scss
|
2502
2506
|
- app/pb_kits/playbook/tokens/_transition.scss
|
2503
2507
|
- app/pb_kits/playbook/tokens/_typography.scss
|
@@ -2527,6 +2531,7 @@ files:
|
|
2527
2531
|
- app/pb_kits/playbook/utilities/_positioning.scss
|
2528
2532
|
- app/pb_kits/playbook/utilities/_shadow.scss
|
2529
2533
|
- app/pb_kits/playbook/utilities/_spacing.scss
|
2534
|
+
- app/pb_kits/playbook/utilities/_text_align.scss
|
2530
2535
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_align_content.scss
|
2531
2536
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_align_items.scss
|
2532
2537
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_align_self.scss
|
@@ -2613,6 +2618,7 @@ files:
|
|
2613
2618
|
- lib/playbook/props/string.rb
|
2614
2619
|
- lib/playbook/shadow.rb
|
2615
2620
|
- lib/playbook/spacing.rb
|
2621
|
+
- lib/playbook/text_align.rb
|
2616
2622
|
- lib/playbook/version.rb
|
2617
2623
|
- lib/playbook/z_index.rb
|
2618
2624
|
- lib/playbook_ui.rb
|
@@ -2620,7 +2626,7 @@ homepage: https://playbook.powerapp.cloud/
|
|
2620
2626
|
licenses:
|
2621
2627
|
- ISC
|
2622
2628
|
metadata: {}
|
2623
|
-
post_install_message:
|
2629
|
+
post_install_message:
|
2624
2630
|
rdoc_options: []
|
2625
2631
|
require_paths:
|
2626
2632
|
- lib
|
@@ -2631,12 +2637,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2631
2637
|
version: '0'
|
2632
2638
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2633
2639
|
requirements:
|
2634
|
-
- - "
|
2640
|
+
- - ">"
|
2635
2641
|
- !ruby/object:Gem::Version
|
2636
|
-
version:
|
2642
|
+
version: 1.3.1
|
2637
2643
|
requirements: []
|
2638
2644
|
rubygems_version: 3.3.7
|
2639
|
-
signing_key:
|
2645
|
+
signing_key:
|
2640
2646
|
specification_version: 4
|
2641
2647
|
summary: Playbook Design System
|
2642
2648
|
test_files: []
|