playbook_ui 14.5.0.pre.alpha.PBNTR614advancedtablepoc4155 → 14.5.0.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4094
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/pb_advanced_table/_advanced_table.tsx +7 -26
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -2
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +4 -20
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +2 -2
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +65 -169
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.test.js +5 -5
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +9 -15
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +6 -28
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb +1 -31
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +3 -1
- data/dist/chunks/_weekday_stacked-B0Zid7Rv.js +45 -0
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +3 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx +0 -52
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +0 -45
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.md +0 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_size.html.erb +0 -336
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_size.jsx +0 -97
- data/dist/chunks/_weekday_stacked-leC2i6B3.js +0 -45
@@ -1,15 +1,5 @@
|
|
1
1
|
<%= pb_content_tag do %>
|
2
|
-
<%= pb_rails(
|
3
|
-
"avatar",
|
4
|
-
props: object.users[0].merge({
|
5
|
-
classname: "pb_multiple_users_stacked_item first_item" +
|
6
|
-
(object.double_bubble ? " double_bubble" : "") +
|
7
|
-
(object.triple_bubble ? " triple_bubble" : "") +
|
8
|
-
(object.quadruple_bubble ? " quadruple_bubble" : ""),
|
9
|
-
dark: object.dark,
|
10
|
-
size: 'xs'
|
11
|
-
})
|
12
|
-
) %>
|
2
|
+
<%= pb_rails("avatar", props: object.users[0].merge({size: object.bubble ? "sm" : "xs", classname: "pb_multiple_users_stacked_item first_item#{object.triple_bubble ? " triple_bubble" : ""}#{object.quadruple_bubble ? " quadruple_bubble" : ""}", dark: object.dark}) ) %>
|
13
3
|
|
14
4
|
<% unless object.only_one %>
|
15
5
|
<% if object.more_than_two && !object.bubble %>
|
@@ -18,26 +8,14 @@
|
|
18
8
|
text: "+#{object.users.count - object.display_count}",
|
19
9
|
variant: "primary",
|
20
10
|
rounded: true,
|
21
|
-
classname: "pb_multiple_users_stacked_item second_item"
|
22
|
-
}) %>
|
11
|
+
classname: "pb_multiple_users_stacked_item second_item" }) %>
|
23
12
|
<% elsif object.bubble %>
|
24
|
-
<% object.users.slice(1,
|
25
|
-
<%= pb_rails(
|
26
|
-
"avatar",
|
27
|
-
props: item.merge({
|
28
|
-
classname: object.bubble_classname(idx),
|
29
|
-
dark: object.dark
|
30
|
-
})
|
31
|
-
) %>
|
13
|
+
<% object.users.slice(1,3).each_with_index do |item, idx| %>
|
14
|
+
<%= pb_rails("avatar", props: item.merge({size: "xs", classname: "pb_multiple_users_stacked_item #{idx == 0 ? "second_item#{object.triple_bubble ? " triple_bubble" : ""}#{object.quadruple_bubble ? " quadruple_bubble" : ""}" : idx == 1 ? "third_item#{object.quadruple_bubble ? " quadruple_bubble" : ""}" : "fourth_item"}", dark: object.dark}) ) %>
|
32
15
|
<% end %>
|
33
16
|
<% else %>
|
34
|
-
<%= pb_rails(
|
35
|
-
"avatar",
|
36
|
-
props: object.users[1].merge({
|
37
|
-
classname: "pb_multiple_users_stacked_item second_item",
|
38
|
-
dark: object.dark
|
39
|
-
})
|
40
|
-
) %>
|
17
|
+
<%= pb_rails("avatar", props: object.users[1].merge({size: "xs", classname: "pb_multiple_users_stacked_item second_item", dark: object.dark}) ) %>
|
41
18
|
<% end %>
|
42
19
|
<% end %>
|
20
|
+
|
43
21
|
<% end %>
|
@@ -4,9 +4,6 @@ module Playbook
|
|
4
4
|
module PbMultipleUsersStacked
|
5
5
|
class MultipleUsersStacked < Playbook::KitBase
|
6
6
|
prop :users, type: Playbook::Props::HashArray, required: true
|
7
|
-
prop :size, type: Playbook::Props::Enum,
|
8
|
-
values: %w[sm md lg xl],
|
9
|
-
default: "sm"
|
10
7
|
|
11
8
|
prop :variant, type: Playbook::Props::Enum,
|
12
9
|
values: %w[default bubble],
|
@@ -28,10 +25,6 @@ module Playbook
|
|
28
25
|
variant == "bubble"
|
29
26
|
end
|
30
27
|
|
31
|
-
def double_bubble
|
32
|
-
bubble && users.count === 2
|
33
|
-
end
|
34
|
-
|
35
28
|
def triple_bubble
|
36
29
|
bubble && users.count === 3
|
37
30
|
end
|
@@ -40,31 +33,8 @@ module Playbook
|
|
40
33
|
bubble && users.count > 3
|
41
34
|
end
|
42
35
|
|
43
|
-
def size_class
|
44
|
-
"size_#{size}" if bubble
|
45
|
-
end
|
46
|
-
|
47
36
|
def classname
|
48
|
-
generate_classname("pb_multiple_users_stacked_kit", single_class, bubble_class
|
49
|
-
end
|
50
|
-
|
51
|
-
def bubble_classname(index)
|
52
|
-
base_classname = "pb_multiple_users_stacked_item "
|
53
|
-
|
54
|
-
case index
|
55
|
-
when 0
|
56
|
-
base_classname += "second_item"
|
57
|
-
base_classname += " double_bubble" if double_bubble
|
58
|
-
base_classname += " triple_bubble" if triple_bubble
|
59
|
-
base_classname += " quadruple_bubble" if quadruple_bubble
|
60
|
-
when 1
|
61
|
-
base_classname += "third_item"
|
62
|
-
base_classname += " quadruple_bubble" if quadruple_bubble
|
63
|
-
else
|
64
|
-
base_classname += "fourth_item"
|
65
|
-
end
|
66
|
-
|
67
|
-
base_classname
|
37
|
+
generate_classname("pb_multiple_users_stacked_kit", single_class, bubble_class)
|
68
38
|
end
|
69
39
|
|
70
40
|
private
|
@@ -28,7 +28,6 @@ $pb_selectable_card_border: 2px;
|
|
28
28
|
padding: $space_sm;
|
29
29
|
margin-bottom: $space_sm;
|
30
30
|
cursor: pointer;
|
31
|
-
outline: 1px solid transparent;
|
32
31
|
|
33
32
|
@media (hover:hover) {
|
34
33
|
&:hover {
|
@@ -74,6 +73,9 @@ $pb_selectable_card_border: 2px;
|
|
74
73
|
|
75
74
|
position: relative;
|
76
75
|
@include pb_card_selected;
|
76
|
+
// Selected card has 1px more border
|
77
|
+
// Remove 1px so content does not "jump"
|
78
|
+
padding: calc($space_sm - 1px);
|
77
79
|
transition-property: none;
|
78
80
|
transition-duration: 0s;
|
79
81
|
|