playbook_ui 12.31.0 → 12.33.0.pre.alpha.revert2650closedialogonoutsideclick977
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/index.js +1 -1
- data/app/pb_kits/playbook/pb_background/_background.tsx +10 -1
- data/app/pb_kits/playbook/pb_background/background.html.erb +2 -1
- data/app/pb_kits/playbook/pb_background/background.rb +4 -2
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +1 -0
- data/app/pb_kits/playbook/pb_button/_button_mixins.scss +6 -6
- data/app/pb_kits/playbook/pb_button/docs/_button_hover.html.erb +3 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +1 -1
- data/app/pb_kits/playbook/pb_date/_date.tsx +7 -8
- data/app/pb_kits/playbook/pb_date/docs/_date_alignment.jsx +2 -2
- data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +4 -4
- data/app/pb_kits/playbook/pb_date/docs/_date_unstyled.jsx +2 -2
- data/app/pb_kits/playbook/pb_date/docs/_date_variants.jsx +5 -5
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +37 -31
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +45 -31
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +5 -3
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +24 -21
- data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +1 -1
- data/app/pb_kits/playbook/pb_date_time/dateTime.test.js +1 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +1 -1
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +6 -8
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +321 -316
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +12 -9
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +8 -8
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +28 -19
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_children.html.erb +17 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_children.jsx +33 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_children.md +3 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +8 -2
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +4 -2
- data/app/pb_kits/playbook/pb_icon/docs/_icon_fa_kit.html.erb +1 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_fa_kit.jsx +21 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_fa_kit.md +7 -0
- data/app/pb_kits/playbook/pb_icon/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_icon/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_icon/icon.rb +1 -1
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +14 -4
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.rb +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +12 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.html.erb +6 -0
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.jsx +9 -0
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +16 -12
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +2 -2
- data/app/pb_kits/playbook/pb_kit/dateTime.ts +139 -67
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +52 -31
- data/app/pb_kits/playbook/pb_map/_map.scss +4 -0
- data/app/pb_kits/playbook/pb_message/_message.tsx +24 -24
- data/app/pb_kits/playbook/pb_message/docs/_message_hover.html.erb +25 -0
- data/app/pb_kits/playbook/pb_message/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +12 -1
- data/app/pb_kits/playbook/pb_time/_time.tsx +9 -11
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +46 -49
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +4 -6
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +11 -11
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +8 -11
- data/app/pb_kits/playbook/tokens/_colors.scss +4 -2
- data/app/pb_kits/playbook/utilities/_border_radius.scss +11 -1
- data/app/pb_kits/playbook/utilities/_hover.scss +1 -1
- data/app/pb_kits/playbook/utilities/_line_height.scss +1 -2
- data/app/pb_kits/playbook/utilities/_shadow.scss +0 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +2 -2
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/border_radius.rb +29 -0
- data/lib/playbook/classnames.rb +2 -0
- data/lib/playbook/hover.rb +60 -0
- data/lib/playbook/kit_base.rb +4 -0
- data/lib/playbook/version.rb +2 -2
- metadata +17 -8
- data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +0 -120
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Playbook
|
4
|
+
module BorderRadius
|
5
|
+
def self.included(base)
|
6
|
+
base.prop :border_radius
|
7
|
+
end
|
8
|
+
|
9
|
+
def border_radius_props
|
10
|
+
selected_props = border_radius_options.keys.select { |sk| try(sk) }
|
11
|
+
return nil unless selected_props.present?
|
12
|
+
|
13
|
+
selected_props.map do |k|
|
14
|
+
border_radius_value = send(k)
|
15
|
+
"border_radius_#{border_radius_value}" if border_radius_values.include? border_radius_value
|
16
|
+
end.compact.join(" ")
|
17
|
+
end
|
18
|
+
|
19
|
+
def border_radius_options
|
20
|
+
{
|
21
|
+
border_radius: "border_radius",
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
def border_radius_values
|
26
|
+
%w[none xs sm md lg xl rounded]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/playbook/classnames.rb
CHANGED
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Playbook
|
4
|
+
module Hover
|
5
|
+
def self.included(base)
|
6
|
+
base.prop :hover
|
7
|
+
end
|
8
|
+
|
9
|
+
def hover_options
|
10
|
+
{
|
11
|
+
hover: "hover",
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
def hover_shadow_values
|
16
|
+
%w[deep deeper deepest]
|
17
|
+
end
|
18
|
+
|
19
|
+
def hover_scale_values
|
20
|
+
%w[sm md lg]
|
21
|
+
end
|
22
|
+
|
23
|
+
def hover_background_values
|
24
|
+
[]
|
25
|
+
end
|
26
|
+
|
27
|
+
def hover_values
|
28
|
+
hover_options.keys.select { |sk| try(sk) }
|
29
|
+
end
|
30
|
+
|
31
|
+
def hover_attributes
|
32
|
+
%w[background shadow scale]
|
33
|
+
end
|
34
|
+
|
35
|
+
def hover_props
|
36
|
+
selected_props = hover_options.keys.select { |sk| try(sk) }
|
37
|
+
return nil unless selected_props.present?
|
38
|
+
|
39
|
+
responsive = selected_props.present? && try(selected_props.first).is_a?(::Hash)
|
40
|
+
css = ""
|
41
|
+
selected_props.each do |prop|
|
42
|
+
value = send(prop)
|
43
|
+
prefix = hover_options[prop]
|
44
|
+
if responsive
|
45
|
+
value.each do |key, val|
|
46
|
+
if key == :background
|
47
|
+
css += "#{prefix}_#{key}_#{val} " if hover_attributes.include?(key.to_s)
|
48
|
+
elsif hover_attributes.include?(key.to_s) && send("hover_#{key}_values").include?(val.to_s)
|
49
|
+
css += "#{prefix}_#{key}_#{val} "
|
50
|
+
end
|
51
|
+
end
|
52
|
+
elsif send("hover_#{prop}_values").include?(value)
|
53
|
+
css += "#{prefix}_#{value} "
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
css.strip unless css.blank?
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
data/lib/playbook/kit_base.rb
CHANGED
@@ -20,6 +20,8 @@ require "playbook/flex_grow"
|
|
20
20
|
require "playbook/flex_shrink"
|
21
21
|
require "playbook/order"
|
22
22
|
require "playbook/position"
|
23
|
+
require "playbook/hover"
|
24
|
+
require "playbook/border_radius"
|
23
25
|
|
24
26
|
module Playbook
|
25
27
|
class KitBase < ViewComponent::Base
|
@@ -45,6 +47,8 @@ module Playbook
|
|
45
47
|
include Playbook::FlexShrink
|
46
48
|
include Playbook::Order
|
47
49
|
include Playbook::Position
|
50
|
+
include Playbook::Hover
|
51
|
+
include Playbook::BorderRadius
|
48
52
|
|
49
53
|
prop :id
|
50
54
|
prop :data, type: Playbook::Props::Hash, default: {}
|
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: 12.
|
4
|
+
version: 12.33.0.pre.alpha.revert2650closedialogonoutsideclick977
|
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-07-
|
12
|
+
date: 2023-07-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -429,6 +429,7 @@ files:
|
|
429
429
|
- app/pb_kits/playbook/pb_button/docs/_button_full_width.html.erb
|
430
430
|
- app/pb_kits/playbook/pb_button/docs/_button_full_width.jsx
|
431
431
|
- app/pb_kits/playbook/pb_button/docs/_button_full_width.md
|
432
|
+
- app/pb_kits/playbook/pb_button/docs/_button_hover.html.erb
|
432
433
|
- app/pb_kits/playbook/pb_button/docs/_button_hover.jsx
|
433
434
|
- app/pb_kits/playbook/pb_button/docs/_button_icon_options.html.erb
|
434
435
|
- app/pb_kits/playbook/pb_button/docs/_button_icon_options.jsx
|
@@ -970,6 +971,9 @@ files:
|
|
970
971
|
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_description.md
|
971
972
|
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
|
972
973
|
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.md
|
974
|
+
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_children.html.erb
|
975
|
+
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_children.jsx
|
976
|
+
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_children.md
|
973
977
|
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close.html.erb
|
974
978
|
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close.jsx
|
975
979
|
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_default.html.erb
|
@@ -1167,6 +1171,9 @@ files:
|
|
1167
1171
|
- app/pb_kits/playbook/pb_icon/docs/_icon_custom.md
|
1168
1172
|
- app/pb_kits/playbook/pb_icon/docs/_icon_default.html.erb
|
1169
1173
|
- app/pb_kits/playbook/pb_icon/docs/_icon_default.jsx
|
1174
|
+
- app/pb_kits/playbook/pb_icon/docs/_icon_fa_kit.html.erb
|
1175
|
+
- app/pb_kits/playbook/pb_icon/docs/_icon_fa_kit.jsx
|
1176
|
+
- app/pb_kits/playbook/pb_icon/docs/_icon_fa_kit.md
|
1170
1177
|
- app/pb_kits/playbook/pb_icon/docs/_icon_flip.html.erb
|
1171
1178
|
- app/pb_kits/playbook/pb_icon/docs/_icon_flip.jsx
|
1172
1179
|
- app/pb_kits/playbook/pb_icon/docs/_icon_pull.html.erb
|
@@ -1415,7 +1422,6 @@ files:
|
|
1415
1422
|
- app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb
|
1416
1423
|
- app/pb_kits/playbook/pb_loading_inline/loading_inline.rb
|
1417
1424
|
- app/pb_kits/playbook/pb_loading_inline/loading_inline.test.js
|
1418
|
-
- app/pb_kits/playbook/pb_logistic/_logistic.jsx
|
1419
1425
|
- app/pb_kits/playbook/pb_map/_map.scss
|
1420
1426
|
- app/pb_kits/playbook/pb_map/_map.tsx
|
1421
1427
|
- app/pb_kits/playbook/pb_map/_map_controls.tsx
|
@@ -1439,6 +1445,7 @@ files:
|
|
1439
1445
|
- app/pb_kits/playbook/pb_message/docs/_message_default.html.erb
|
1440
1446
|
- app/pb_kits/playbook/pb_message/docs/_message_default.jsx
|
1441
1447
|
- app/pb_kits/playbook/pb_message/docs/_message_default.md
|
1448
|
+
- app/pb_kits/playbook/pb_message/docs/_message_hover.html.erb
|
1442
1449
|
- app/pb_kits/playbook/pb_message/docs/_message_hover.jsx
|
1443
1450
|
- app/pb_kits/playbook/pb_message/docs/_message_timestamp.html.erb
|
1444
1451
|
- app/pb_kits/playbook/pb_message/docs/_message_timestamp.jsx
|
@@ -2481,6 +2488,7 @@ files:
|
|
2481
2488
|
- lib/playbook/align_content.rb
|
2482
2489
|
- lib/playbook/align_items.rb
|
2483
2490
|
- lib/playbook/align_self.rb
|
2491
|
+
- lib/playbook/border_radius.rb
|
2484
2492
|
- lib/playbook/classnames.rb
|
2485
2493
|
- lib/playbook/cursor.rb
|
2486
2494
|
- lib/playbook/display.rb
|
@@ -2501,6 +2509,7 @@ files:
|
|
2501
2509
|
- lib/playbook/forms/builder/multi_level_select_field.rb
|
2502
2510
|
- lib/playbook/forms/builder/select_field.rb
|
2503
2511
|
- lib/playbook/forms/builder/typeahead_field.rb
|
2512
|
+
- lib/playbook/hover.rb
|
2504
2513
|
- lib/playbook/justify_content.rb
|
2505
2514
|
- lib/playbook/justify_self.rb
|
2506
2515
|
- lib/playbook/kit_base.rb
|
@@ -2537,7 +2546,7 @@ homepage: https://playbook.powerapp.cloud/
|
|
2537
2546
|
licenses:
|
2538
2547
|
- ISC
|
2539
2548
|
metadata: {}
|
2540
|
-
post_install_message:
|
2549
|
+
post_install_message:
|
2541
2550
|
rdoc_options: []
|
2542
2551
|
require_paths:
|
2543
2552
|
- lib
|
@@ -2548,12 +2557,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2548
2557
|
version: '0'
|
2549
2558
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2550
2559
|
requirements:
|
2551
|
-
- - "
|
2560
|
+
- - ">"
|
2552
2561
|
- !ruby/object:Gem::Version
|
2553
|
-
version:
|
2562
|
+
version: 1.3.1
|
2554
2563
|
requirements: []
|
2555
2564
|
rubygems_version: 3.3.7
|
2556
|
-
signing_key:
|
2565
|
+
signing_key:
|
2557
2566
|
specification_version: 4
|
2558
2567
|
summary: Playbook Design System
|
2559
2568
|
test_files: []
|
@@ -1,120 +0,0 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
|
-
import React from 'react'
|
4
|
-
import classnames from 'classnames'
|
5
|
-
|
6
|
-
import DateTime from '../pb_kit/dateTime'
|
7
|
-
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
8
|
-
import { globalProps } from '../utilities/globalProps'
|
9
|
-
|
10
|
-
import Body from '../pb_body/_body'
|
11
|
-
import Caption from '../pb_caption/_caption'
|
12
|
-
import Icon from '../pb_icon/_icon'
|
13
|
-
import Title from '../pb_title/_title'
|
14
|
-
|
15
|
-
const dateString = (value: DateTime) => {
|
16
|
-
const month = value.toMonthNum()
|
17
|
-
const day = value.toDay()
|
18
|
-
|
19
|
-
return ` · ${month}/${day}`
|
20
|
-
}
|
21
|
-
|
22
|
-
type LogisticProps = {
|
23
|
-
aria?: object,
|
24
|
-
className?: string,
|
25
|
-
dark?: boolean,
|
26
|
-
data?: object,
|
27
|
-
date: string,
|
28
|
-
id?: string,
|
29
|
-
link?: string,
|
30
|
-
projectName?: string,
|
31
|
-
projectNumber?: number,
|
32
|
-
}
|
33
|
-
|
34
|
-
const Logistic = (props: LogisticProps) => {
|
35
|
-
const { aria = {},
|
36
|
-
className,
|
37
|
-
dark = false,
|
38
|
-
data = {},
|
39
|
-
date,
|
40
|
-
id,
|
41
|
-
link,
|
42
|
-
projectName,
|
43
|
-
projectNumber } = props
|
44
|
-
|
45
|
-
const ariaProps = buildAriaProps(aria)
|
46
|
-
const dataProps = buildDataProps(data)
|
47
|
-
const formattedDate = new DateTime({ value: date })
|
48
|
-
const classes = classnames(
|
49
|
-
buildCss('pb_logistic_kit', { dark }),
|
50
|
-
globalProps(props),
|
51
|
-
className
|
52
|
-
)
|
53
|
-
|
54
|
-
return (
|
55
|
-
<div
|
56
|
-
{...ariaProps}
|
57
|
-
{...dataProps}
|
58
|
-
className={classes}
|
59
|
-
id={id}
|
60
|
-
>
|
61
|
-
<Body color="light">
|
62
|
-
<Caption text="Project" />
|
63
|
-
<Icon
|
64
|
-
fixedWidth
|
65
|
-
icon="home"
|
66
|
-
/>
|
67
|
-
|
68
|
-
{` ${projectNumber}`}
|
69
|
-
|
70
|
-
<Choose>
|
71
|
-
<When condition={link}>
|
72
|
-
<a
|
73
|
-
className="pb_logistic_kit_links"
|
74
|
-
href={link}
|
75
|
-
>
|
76
|
-
<Choose>
|
77
|
-
<When condition={date}>
|
78
|
-
<Title
|
79
|
-
size={4}
|
80
|
-
tag="span"
|
81
|
-
text={' ' + projectName + dateString(formattedDate)}
|
82
|
-
/>
|
83
|
-
</When>
|
84
|
-
<Otherwise>
|
85
|
-
<Title
|
86
|
-
size={4}
|
87
|
-
tag="span"
|
88
|
-
text={' ' + projectName}
|
89
|
-
/>
|
90
|
-
</Otherwise>
|
91
|
-
</Choose>
|
92
|
-
</a>
|
93
|
-
</When>
|
94
|
-
<Otherwise>
|
95
|
-
<Choose>
|
96
|
-
<When condition={date}>
|
97
|
-
<Title
|
98
|
-
dark={dark}
|
99
|
-
size={4}
|
100
|
-
tag="span"
|
101
|
-
text={' ' + projectName + dateString(formattedDate)}
|
102
|
-
/>
|
103
|
-
</When>
|
104
|
-
<Otherwise>
|
105
|
-
<Title
|
106
|
-
dark={dark}
|
107
|
-
size={4}
|
108
|
-
tag="span"
|
109
|
-
text={' ' + projectName}
|
110
|
-
/>
|
111
|
-
</Otherwise>
|
112
|
-
</Choose>
|
113
|
-
</Otherwise>
|
114
|
-
</Choose>
|
115
|
-
</Body>
|
116
|
-
</div>
|
117
|
-
)
|
118
|
-
}
|
119
|
-
|
120
|
-
export default Logistic
|