playbook_ui 12.33.1.pre.alpha.PLAY933navkitcollapsible994 → 12.34.0.pre.alpha.fixdialogcloseevents1003
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_button/_button.scss +32 -0
- data/app/pb_kits/playbook/pb_button/_button.tsx +78 -26
- data/app/pb_kits/playbook/pb_button/button.html.erb +17 -0
- data/app/pb_kits/playbook/pb_button/button.rb +18 -2
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb +30 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction.jsx +47 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction.md +3 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_button/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +4 -6
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +11 -19
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +14 -27
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +2 -7
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.rb +7 -2
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_size.md +1 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_collapsible/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_collapsible/index.js +3 -3
- data/app/pb_kits/playbook/pb_collapsible/types.d.ts +1 -0
- data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +7 -4
- data/app/pb_kits/playbook/pb_icon/_icon.scss +4 -0
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -2
- data/app/pb_kits/playbook/pb_icon/icon.html.erb +1 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +49 -98
- data/app/pb_kits/playbook/pb_nav/_nav.scss +0 -1
- data/app/pb_kits/playbook/pb_nav/_subtle_mixin.scss +11 -9
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +0 -3
- data/app/pb_kits/playbook/pb_nav/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_nav/item.html.erb +12 -34
- data/app/pb_kits/playbook/pb_nav/item.rb +0 -5
- data/dist/playbook-rails.js +6 -6
- data/lib/playbook/version.rb +2 -2
- metadata +6 -10
- data/app/pb_kits/playbook/pb_collapsible/_helper_functions.ts +0 -25
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.html.erb +0 -10
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +0 -19
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.md +0 -2
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +0 -6
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.html.erb +0 -24
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +0 -83
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom_icons.jsx +0 -86
@@ -21,15 +21,18 @@ const dialogHelper = () => {
|
|
21
21
|
|
22
22
|
// Close dialog box on outside click
|
23
23
|
dialogs.forEach((dialogElement) => {
|
24
|
-
dialogElement.addEventListener("
|
24
|
+
dialogElement.addEventListener("mousedown", (event) => {
|
25
25
|
const dialogParentDataset = dialogElement.parentElement.dataset
|
26
26
|
if (dialogParentDataset.overlayClick === "overlay_close") return
|
27
27
|
|
28
|
-
const
|
28
|
+
const dialogModal = event.target.getBoundingClientRect()
|
29
|
+
const clickedOutsideDialogModal = dialogModal.left > event.clientX ||
|
30
|
+
dialogModal.right < event.clientX ||
|
31
|
+
dialogModal.top > event.clientY ||
|
32
|
+
dialogModal.bottom < event.clientY
|
29
33
|
|
30
|
-
if (
|
34
|
+
if (clickedOutsideDialogModal) {
|
31
35
|
dialogElement.close()
|
32
|
-
event.stopPropagation()
|
33
36
|
}
|
34
37
|
})
|
35
38
|
})
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<% if object.custom_icon %>
|
2
2
|
<%= object.render_svg(object.custom_icon) %>
|
3
3
|
<% elsif object.valid_emoji(object.icon) %>
|
4
|
-
<span class="
|
4
|
+
<span class="pb_icon_kit_emoji"><%= object.icon.html_safe %></span>
|
5
5
|
<% else %>
|
6
6
|
<%= content_tag(:i, nil,
|
7
7
|
id: object.id,
|
@@ -6,17 +6,15 @@ import { globalProps, GlobalProps } from '../utilities/globalProps'
|
|
6
6
|
|
7
7
|
import Icon from '../pb_icon/_icon'
|
8
8
|
import Image from '../pb_image/_image'
|
9
|
-
import Collapsible from '../pb_collapsible/_collapsible'
|
10
9
|
|
11
10
|
type NavItemProps = {
|
12
11
|
active?: boolean,
|
13
12
|
aria?: { [key: string]: string },
|
14
13
|
children?: React.ReactNode[] | React.ReactNode,
|
15
14
|
className?: string,
|
16
|
-
collapsible?: boolean,
|
17
15
|
data?: object,
|
18
16
|
iconLeft?: string,
|
19
|
-
iconRight?: string
|
17
|
+
iconRight?: string,
|
20
18
|
id?: string,
|
21
19
|
imageUrl?: string,
|
22
20
|
link?: string,
|
@@ -31,7 +29,6 @@ const NavItem = (props: NavItemProps) => {
|
|
31
29
|
aria = {},
|
32
30
|
children,
|
33
31
|
className,
|
34
|
-
collapsible,
|
35
32
|
data = {},
|
36
33
|
iconLeft,
|
37
34
|
iconRight,
|
@@ -56,100 +53,54 @@ const NavItem = (props: NavItemProps) => {
|
|
56
53
|
className={classes}
|
57
54
|
id={id}
|
58
55
|
>
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
<
|
71
|
-
className="
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
<
|
83
|
-
className="
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
target={target}
|
108
|
-
>
|
109
|
-
{imageUrl &&
|
110
|
-
<div
|
111
|
-
className="pb_nav_list_item_icon_section"
|
112
|
-
key={imageUrl}
|
113
|
-
>
|
114
|
-
<Image
|
115
|
-
className="pb_nav_img_wrapper"
|
116
|
-
url={imageUrl}
|
117
|
-
/>
|
118
|
-
</div>
|
119
|
-
}
|
120
|
-
|
121
|
-
{iconLeft &&
|
122
|
-
<div
|
123
|
-
className="pb_nav_list_item_icon_section"
|
124
|
-
key={iconLeft}
|
125
|
-
>
|
126
|
-
<Icon
|
127
|
-
className="pb_nav_list_item_icon_left"
|
128
|
-
fixedWidth
|
129
|
-
icon={iconLeft}
|
130
|
-
/>
|
131
|
-
</div>
|
132
|
-
}
|
133
|
-
|
134
|
-
<span className="pb_nav_list_item_text">
|
135
|
-
{text || children}
|
136
|
-
</span>
|
137
|
-
|
138
|
-
{iconRight &&
|
139
|
-
<div
|
140
|
-
className="pb_nav_list_item_icon_section"
|
141
|
-
key={iconRight as string}
|
142
|
-
>
|
143
|
-
<Icon
|
144
|
-
className="pb_nav_list_item_icon_right"
|
145
|
-
fixedWidth
|
146
|
-
icon={iconRight as string}
|
147
|
-
/>
|
148
|
-
</div>
|
149
|
-
}
|
150
|
-
</Tag>
|
151
|
-
)
|
152
|
-
}
|
56
|
+
<Tag
|
57
|
+
className="pb_nav_list_item_link"
|
58
|
+
href={link}
|
59
|
+
onClick={onClick}
|
60
|
+
target={target}
|
61
|
+
>
|
62
|
+
{imageUrl &&
|
63
|
+
<div
|
64
|
+
className="pb_nav_list_item_icon_section"
|
65
|
+
key={imageUrl}
|
66
|
+
>
|
67
|
+
<Image
|
68
|
+
className="pb_nav_img_wrapper"
|
69
|
+
url={imageUrl}
|
70
|
+
/>
|
71
|
+
</div>
|
72
|
+
}
|
73
|
+
|
74
|
+
{iconLeft &&
|
75
|
+
<div
|
76
|
+
className="pb_nav_list_item_icon_section"
|
77
|
+
key={iconLeft}
|
78
|
+
>
|
79
|
+
<Icon
|
80
|
+
className="pb_nav_list_item_icon_left"
|
81
|
+
fixedWidth
|
82
|
+
icon={iconLeft}
|
83
|
+
/>
|
84
|
+
</div>
|
85
|
+
}
|
86
|
+
|
87
|
+
<span className="pb_nav_list_item_text">
|
88
|
+
{text || children}
|
89
|
+
</span>
|
90
|
+
|
91
|
+
{iconRight &&
|
92
|
+
<div
|
93
|
+
className="pb_nav_list_item_icon_section"
|
94
|
+
key={iconRight}
|
95
|
+
>
|
96
|
+
<Icon
|
97
|
+
className="pb_nav_list_item_icon_right"
|
98
|
+
fixedWidth
|
99
|
+
icon={iconRight}
|
100
|
+
/>
|
101
|
+
</div>
|
102
|
+
}
|
103
|
+
</Tag>
|
153
104
|
</li>
|
154
105
|
)
|
155
106
|
}
|
@@ -29,20 +29,22 @@
|
|
29
29
|
flex: 1;
|
30
30
|
font-weight: $regular;
|
31
31
|
}
|
32
|
+
@media (hover:hover) {
|
33
|
+
&:hover {
|
34
|
+
background-color: rgba($primary, 0.03);
|
35
|
+
[class*=_icon] {
|
36
|
+
color: $primary;
|
37
|
+
}
|
38
|
+
[class*=_text] {
|
39
|
+
color: $primary;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
32
43
|
}
|
33
44
|
&[class*=_active] [class*=_link] {
|
34
45
|
@include pb_title_4;
|
35
46
|
color: $primary;
|
36
47
|
letter-spacing: normal;
|
37
48
|
}
|
38
|
-
&:hover {
|
39
|
-
background-color: rgba($primary, 0.03);
|
40
|
-
[class*=_icon] {
|
41
|
-
color: $primary;
|
42
|
-
}
|
43
|
-
[class*=_text] {
|
44
|
-
color: $primary;
|
45
|
-
}
|
46
|
-
}
|
47
49
|
}
|
48
50
|
}
|
@@ -7,7 +7,6 @@ examples:
|
|
7
7
|
- borderless_nav: No Borders
|
8
8
|
- subtle_nav: Subtle Variant
|
9
9
|
- subtle_with_icons_nav: Subtle With Icons
|
10
|
-
- collapsible_nav: Subtle With Collapsible
|
11
10
|
- subtle_no_highlight_nav: Subtle No Highlight
|
12
11
|
- bold_vertical_nav: Bold Variant
|
13
12
|
- horizontal_nav: Horizontal Nav
|
@@ -25,8 +24,6 @@ examples:
|
|
25
24
|
- borderless_nav: No Borders
|
26
25
|
- subtle_nav: Subtle Variant
|
27
26
|
- subtle_with_icons_nav: Subtle With Icons
|
28
|
-
- collapsible_nav: Subtle With Collapsible
|
29
|
-
- collapsible_nav_custom_icons: Subtle With Collapsible (Custom Toggle Icons)
|
30
27
|
- subtle_no_highlight_nav: Subtle No Highlight
|
31
28
|
- bold_vertical_nav: Bold Variant
|
32
29
|
- horizontal_nav: Horizontal Nav
|
@@ -13,5 +13,3 @@ export { default as WithImgNav } from './_with_img_nav.jsx'
|
|
13
13
|
export { default as NewTab } from './_new_tab.jsx'
|
14
14
|
export { default as BoldHorizontalNav } from './_bold_horizontal_nav.jsx'
|
15
15
|
export { default as BoldVerticalNav } from './_bold_vertical_nav.jsx'
|
16
|
-
export { default as CollapsibleNav } from './_collapsible_nav.jsx'
|
17
|
-
export { default as CollapsibleNavCustomIcons } from './_collapsible_nav_custom_icons.jsx'
|
@@ -3,41 +3,19 @@
|
|
3
3
|
class: object.classname,
|
4
4
|
data: object.data,
|
5
5
|
id: object.id) do %>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
object.link ? object.link_options : object.options) do %>
|
11
|
-
<% if object.image_url %>
|
12
|
-
<%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper" }) %>
|
13
|
-
<% end %>
|
14
|
-
<% if object.icon_left %>
|
15
|
-
<%= pb_rails("icon", props: { icon: object.icon_left, classname: "pb_nav_list_item_icon_left", fixed_width: true}) %>
|
16
|
-
<% end %>
|
17
|
-
<span class="pb_nav_list_item_text">
|
18
|
-
<%= object.text %>
|
19
|
-
</span>
|
20
|
-
<% end %>
|
21
|
-
<% end %>
|
22
|
-
<%= pb_rails("collapsible/collapsible_content") do %>
|
23
|
-
<%= content.presence %>
|
24
|
-
<% end %>
|
6
|
+
<%= content_tag(object.tag,
|
7
|
+
object.link ? object.link_options : object.options) do %>
|
8
|
+
<% if object.image_url %>
|
9
|
+
<%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper" }) %>
|
25
10
|
<% end %>
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
<% end %>
|
35
|
-
<span class="pb_nav_list_item_text">
|
36
|
-
<%= object.text %><%= content.presence %>
|
37
|
-
</span>
|
38
|
-
<% if object.icon_right %>
|
39
|
-
<%= pb_rails("icon", props: { icon: object.icon_right, classname: "pb_nav_list_item_icon_right", fixed_width: true}) %>
|
40
|
-
<% end %>
|
11
|
+
<% if object.icon_left %>
|
12
|
+
<%= pb_rails("icon", props: { icon: object.icon_left, classname: "pb_nav_list_item_icon_left", fixed_width: true}) %>
|
13
|
+
<% end %>
|
14
|
+
<span class="pb_nav_list_item_text">
|
15
|
+
<%= object.text %><%= content.presence %>
|
16
|
+
</span>
|
17
|
+
<% if object.icon_right %>
|
18
|
+
<%= pb_rails("icon", props: { icon: object.icon_right, classname: "pb_nav_list_item_icon_right", fixed_width: true}) %>
|
41
19
|
<% end %>
|
42
20
|
<% end %>
|
43
21
|
<% end %>
|
@@ -4,7 +4,6 @@ module Playbook
|
|
4
4
|
module PbNav
|
5
5
|
class Item < Playbook::KitBase
|
6
6
|
prop :active, type: Playbook::Props::Boolean, default: false
|
7
|
-
prop :collapsible, type: Playbook::Props::Boolean, default: false
|
8
7
|
prop :link
|
9
8
|
prop :text
|
10
9
|
prop :icon_left
|
@@ -34,10 +33,6 @@ module Playbook
|
|
34
33
|
)
|
35
34
|
end
|
36
35
|
|
37
|
-
def collapsible_icons
|
38
|
-
icon_right.present? ? icon_right : %w[plus minus]
|
39
|
-
end
|
40
|
-
|
41
36
|
private
|
42
37
|
|
43
38
|
def active_class
|