playbook_ui 12.36.0.pre.alpha.PLAY942collapsiblenav21035 → 12.36.0.pre.alpha.svgiconmethods1043
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 -2
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +13 -15
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +8 -24
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +1 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +4 -15
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_icon/docs/_icon_animate.html.erb +1 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.html.erb +2 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_svg.html.erb +4 -0
- data/app/pb_kits/playbook/pb_icon/docs/example.yml +10 -9
- data/app/pb_kits/playbook/pb_icon/icon.html.erb +3 -3
- data/app/pb_kits/playbook/pb_icon/icon.rb +17 -0
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +1 -22
- data/app/pb_kits/playbook/pb_nav/_item.tsx +2 -26
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +79 -59
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom_icons.jsx +6 -4
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_nav/item.rb +1 -5
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/version.rb +1 -1
- metadata +3 -3
- data/app/pb_kits/playbook/pb_collapsible/useCollapsible.tsx +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a55076e0e8167e0db8cbbe9509bf5c99f10e376e0ac56a769c1cc5a5185178ba
|
4
|
+
data.tar.gz: 0e9efeea039a9149b34cfbc3d445845de2c937d892ce380a8af16f449f09e096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2002845578b53dd39bb6f23d5a16de27bdc92618f22b31a8f9f0d4f9134418509b7c80f077112bbccb9b3fa1bf2a1a56376b9cc7d0626423406729e5bce37a5f
|
7
|
+
data.tar.gz: c61aed1e059b92f3fc5753f1ed723425f4bbe4265a1f2cc595f2f0d05ab439ebb17da6cab3251a19830b6a08d996c590a68ce15c889e15029d803c2d64391f11
|
@@ -129,5 +129,4 @@ export { default as PbTypeahead } from './pb_typeahead'
|
|
129
129
|
export { default as dialogHelper } from './pb_dialog/dialogHelper'
|
130
130
|
|
131
131
|
//Theming
|
132
|
-
export {default as mapTheme} from './pb_map/pbMapTheme'
|
133
|
-
export {default as useCollapsible} from './pb_collapsible/useCollapsible'
|
132
|
+
export {default as mapTheme} from './pb_map/pbMapTheme'
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useState } from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
|
-
import useCollapsible from './useCollapsible'
|
4
3
|
|
5
4
|
import { globalProps } from '../utilities/globalProps'
|
6
5
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
@@ -17,15 +16,20 @@ type CollapsibleProps = {
|
|
17
16
|
className?: string,
|
18
17
|
collapsed?: boolean,
|
19
18
|
data?: object,
|
20
|
-
icon?: string | string[]
|
19
|
+
icon?: string | string[]
|
21
20
|
iconColor?: 'default' | 'light' | 'lighter' | 'link' | 'error' | 'success',
|
22
|
-
iconSize?: IconSizes
|
23
|
-
iconClick?: ()=> void,
|
24
|
-
onClick?: ()=> void,
|
21
|
+
iconSize?: IconSizes
|
25
22
|
id?: string,
|
26
23
|
}
|
27
24
|
|
25
|
+
const useCollapsible = (initial = false) => {
|
26
|
+
const [collapsed, setCollapsed] = useState(initial)
|
28
27
|
|
28
|
+
return [
|
29
|
+
collapsed,
|
30
|
+
() => setCollapsed((t) => !t),
|
31
|
+
]
|
32
|
+
}
|
29
33
|
|
30
34
|
const Collapsible = ({
|
31
35
|
aria = {},
|
@@ -36,17 +40,10 @@ const Collapsible = ({
|
|
36
40
|
icon,
|
37
41
|
iconColor = 'default',
|
38
42
|
iconSize,
|
39
|
-
iconClick,
|
40
|
-
onClick,
|
41
43
|
id,
|
42
44
|
...props
|
43
45
|
}: CollapsibleProps) => {
|
44
|
-
const [isCollapsed,
|
45
|
-
|
46
|
-
useEffect(()=> {
|
47
|
-
setIsCollapsed(collapsed)
|
48
|
-
},[collapsed])
|
49
|
-
|
46
|
+
const [isCollapsed, collapse] = useCollapsible(collapsed)
|
50
47
|
const CollapsibleParent = React.Children.toArray(children) as JSX.Element[]
|
51
48
|
|
52
49
|
if (CollapsibleParent.length !== 2) {
|
@@ -65,8 +62,9 @@ const Collapsible = ({
|
|
65
62
|
globalProps(props),
|
66
63
|
className
|
67
64
|
)
|
65
|
+
|
68
66
|
return (
|
69
|
-
<CollapsibleContext.Provider value={{ collapsed: isCollapsed,
|
67
|
+
<CollapsibleContext.Provider value={{ collapsed: isCollapsed, collapse, icon, iconSize, iconColor }}>
|
70
68
|
<div
|
71
69
|
{...ariaProps}
|
72
70
|
{...dataProps}
|
@@ -33,7 +33,7 @@ type CollapsibleMainProps = {
|
|
33
33
|
children: React.ReactNode[] | React.ReactNode,
|
34
34
|
className?: string,
|
35
35
|
cursor?: string,
|
36
|
-
|
36
|
+
|
37
37
|
}
|
38
38
|
type IconColors = "default" | "light" | "lighter" | "link" | "error" | "success"
|
39
39
|
|
@@ -42,10 +42,9 @@ type IconProps = {
|
|
42
42
|
icon?: string[] | string
|
43
43
|
iconColor?: IconColors
|
44
44
|
iconSize?: IconSizes
|
45
|
-
iconClick?: ()=> void
|
46
45
|
}
|
47
46
|
|
48
|
-
const ToggleIcon = ({ collapsed, icon, iconSize, iconColor
|
47
|
+
const ToggleIcon = ({ collapsed, icon, iconSize, iconColor }: IconProps) => {
|
49
48
|
const color = colorMap[iconColor]
|
50
49
|
|
51
50
|
const showIcon = (icon: string |string[]) => {
|
@@ -55,13 +54,6 @@ const ToggleIcon = ({ collapsed, icon, iconSize, iconColor, iconClick }: IconPro
|
|
55
54
|
return icon
|
56
55
|
}
|
57
56
|
|
58
|
-
const handleIconClick = (e:any) => {
|
59
|
-
if (iconClick) {
|
60
|
-
e.stopPropagation();
|
61
|
-
iconClick()
|
62
|
-
}
|
63
|
-
}
|
64
|
-
|
65
57
|
return (
|
66
58
|
<>
|
67
59
|
{collapsed ? (
|
@@ -69,7 +61,6 @@ const ToggleIcon = ({ collapsed, icon, iconSize, iconColor, iconClick }: IconPro
|
|
69
61
|
className="icon_wrapper"
|
70
62
|
key={icon ? showIcon(icon)[0] : "chevron-down"}
|
71
63
|
style={{ verticalAlign: "middle", color: color }}
|
72
|
-
onClick={(e)=> handleIconClick(e)}
|
73
64
|
>
|
74
65
|
<Icon icon={icon ? showIcon(icon)[0] : "chevron-down"} size={iconSize} />
|
75
66
|
</div>
|
@@ -78,7 +69,6 @@ const ToggleIcon = ({ collapsed, icon, iconSize, iconColor, iconClick }: IconPro
|
|
78
69
|
className="icon_wrapper"
|
79
70
|
key={icon ? showIcon(icon)[1] : "chevron-up"}
|
80
71
|
style={{ verticalAlign: "middle", color: color }}
|
81
|
-
onClick={(e)=> handleIconClick(e)}
|
82
72
|
>
|
83
73
|
<Icon icon={icon ? showIcon(icon)[1] : "chevron-up"} size={iconSize} />
|
84
74
|
</div>
|
@@ -93,18 +83,13 @@ const CollapsibleMain = ({
|
|
93
83
|
cursor = 'pointer',
|
94
84
|
...props
|
95
85
|
}: CollapsibleMainProps): React.ReactElement=> {
|
96
|
-
const {
|
86
|
+
const context: {[key: string]: IconColors | (() => void)} | boolean = useContext(CollapsibleContext)
|
97
87
|
const mainCSS = buildCss('pb_collapsible_main_kit')
|
98
88
|
const mainSpacing = globalProps(props, { cursor })
|
99
89
|
|
100
|
-
const handleCollapsibleClick = (e:any) => {
|
101
|
-
toggle();
|
102
|
-
onClick && onClick(e)
|
103
|
-
}
|
104
|
-
|
105
90
|
return (
|
106
91
|
<div className={classnames(mainCSS, className, mainSpacing)}>
|
107
|
-
<div onClick={(
|
92
|
+
<div onClick={context.collapse as (() => void)}>
|
108
93
|
<Flex
|
109
94
|
spacing="between"
|
110
95
|
vertical="center"
|
@@ -112,11 +97,10 @@ const CollapsibleMain = ({
|
|
112
97
|
<FlexItem>{children}</FlexItem>
|
113
98
|
<FlexItem>
|
114
99
|
<ToggleIcon
|
115
|
-
collapsed={collapsed as () => void}
|
116
|
-
iconColor={iconColor as IconColors}
|
117
|
-
iconSize={iconSize as IconSizes}
|
118
|
-
icon={icon as string[] | string}
|
119
|
-
iconClick={iconClick}
|
100
|
+
collapsed={context.collapsed as () => void}
|
101
|
+
iconColor={context.iconColor as IconColors}
|
102
|
+
iconSize={context.iconSize as IconSizes}
|
103
|
+
icon={context.icon as string[] | string}
|
120
104
|
/>
|
121
105
|
</FlexItem>
|
122
106
|
</Flex>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<%= content.presence %>
|
10
10
|
<% end %>
|
11
11
|
<%= pb_rails("flex/flex_item") do %>
|
12
|
-
<div style="color: <%= object.icon_color %>"
|
12
|
+
<div style="color: <%= object.icon_color %>">
|
13
13
|
<% if object.icon.present? %>
|
14
14
|
<%= pb_rails("icon", props: { icon: object.show_icon(object.icon)[0], id:"collapsible_open_icon", size: object.size }) %>
|
15
15
|
<%= pb_rails("icon", props: { icon: object.show_icon(object.icon)[1], id:"collapsible_close_icon", size: object.size }) %>
|
@@ -1,17 +1,8 @@
|
|
1
1
|
import React from 'react'
|
2
|
-
import { Collapsible
|
2
|
+
import { Collapsible } from '../..'
|
3
3
|
|
4
|
-
const CollapsibleIcons = () =>
|
5
|
-
|
6
|
-
|
7
|
-
return (
|
8
|
-
<>
|
9
|
-
<Button onClick={()=> setIsCollapsed(!isCollapsed)}>
|
10
|
-
{isCollapsed ? "Expand" : "Collapse"}
|
11
|
-
</Button>
|
12
|
-
<Collapsible collapsed={isCollapsed}
|
13
|
-
icon={['plus','minus']}
|
14
|
-
>
|
4
|
+
const CollapsibleIcons = () => (
|
5
|
+
<Collapsible icon={['plus','minus']}>
|
15
6
|
<Collapsible.Main>
|
16
7
|
<div>{'Main Section'}</div>
|
17
8
|
</Collapsible.Main>
|
@@ -23,8 +14,6 @@ const CollapsibleIcons = () => {
|
|
23
14
|
</div>
|
24
15
|
</Collapsible.Content>
|
25
16
|
</Collapsible>
|
26
|
-
|
27
|
-
)
|
28
|
-
}
|
17
|
+
)
|
29
18
|
|
30
19
|
export default CollapsibleIcons
|
@@ -4,10 +4,10 @@ examples:
|
|
4
4
|
- collapsible_default: Default
|
5
5
|
- collapsible_size: Size
|
6
6
|
- collapsible_color: Color
|
7
|
-
- collapsible_icons: Custom Icons
|
7
|
+
# - collapsible_icons: Custom Icons
|
8
8
|
|
9
9
|
react:
|
10
10
|
- collapsible_default: Default
|
11
11
|
- collapsible_size: Size
|
12
12
|
- collapsible_color: Color
|
13
|
-
- collapsible_icons: Custom Icons
|
13
|
+
# - collapsible_icons: Custom Icons
|
@@ -1,14 +1,15 @@
|
|
1
1
|
examples:
|
2
2
|
rails:
|
3
|
-
- icon_default: Icon Default
|
4
|
-
- icon_rotate: Icon Rotate
|
5
|
-
- icon_flip: Icon Flip
|
6
|
-
- icon_animate: Icon Animation
|
7
|
-
- icon_pull: Icon Pull
|
8
|
-
- icon_border: Icon Border
|
9
|
-
- icon_sizes: Icon Sizes
|
10
|
-
- icon_custom: Icon Custom
|
11
|
-
- icon_fa_kit: Icon with FontAwesome Kit
|
3
|
+
# - icon_default: Icon Default
|
4
|
+
# - icon_rotate: Icon Rotate
|
5
|
+
# - icon_flip: Icon Flip
|
6
|
+
# - icon_animate: Icon Animation
|
7
|
+
# - icon_pull: Icon Pull
|
8
|
+
# - icon_border: Icon Border
|
9
|
+
# - icon_sizes: Icon Sizes
|
10
|
+
# - icon_custom: Icon Custom
|
11
|
+
# - icon_fa_kit: Icon with FontAwesome Kit
|
12
|
+
- icon_svg: Icon SVG
|
12
13
|
|
13
14
|
react:
|
14
15
|
- icon_default: Icon Default
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<% if object.custom_icon %>
|
2
|
-
<%= object.
|
2
|
+
<%= object.embedded_svg(object.custom_icon) %>
|
3
3
|
<% elsif object.valid_emoji(object.icon) %>
|
4
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,
|
8
8
|
data: object.data,
|
9
|
-
class: object.classname
|
9
|
+
class: object.classname,
|
10
10
|
) %>
|
11
11
|
<%= content_tag(:span, nil,
|
12
12
|
aria: { label: "#{object.icon} icon" }.merge(object.aria),
|
13
13
|
hidden: true
|
14
14
|
) %>
|
15
|
-
<% end %>
|
15
|
+
<% end %>
|
@@ -90,6 +90,23 @@ module Playbook
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
+
def embedded_svg(icon_name)
|
94
|
+
file = File.read(Rails.root.join("app", "javascript", "images", "#{icon_name}.svg"))
|
95
|
+
doc = Nokogiri::HTML::DocumentFragment.parse file
|
96
|
+
svg = doc.at_css "svg"
|
97
|
+
|
98
|
+
doc.to_html.html_safe
|
99
|
+
|
100
|
+
size_factor = size.to_i
|
101
|
+
if size_factor > 1
|
102
|
+
pixel_size = size_factor * 16
|
103
|
+
svg["width"] = pixel_size.to_s
|
104
|
+
svg["height"] = pixel_size.to_s
|
105
|
+
end
|
106
|
+
|
107
|
+
raw doc
|
108
|
+
end
|
109
|
+
|
93
110
|
private
|
94
111
|
|
95
112
|
def border_class
|
@@ -1,27 +1,6 @@
|
|
1
|
-
@import "../tokens/spacing";
|
2
|
-
@import "../tokens/colors";
|
3
|
-
@import "../tokens/border_radius";
|
4
|
-
|
5
1
|
[class^="pb_nav_list"] {
|
6
|
-
.pb_collapsible_nav_item {
|
7
2
|
.pb_collapsible_main_kit,
|
8
|
-
.pb_collapsible_content_kit
|
9
|
-
.pb_collapsible_kit {
|
3
|
+
.pb_collapsible_content_kit {
|
10
4
|
padding: 0 !important;
|
11
5
|
}
|
12
|
-
|
13
|
-
.icon_wrapper {
|
14
|
-
border-radius: $border_radius_rounded;
|
15
|
-
width: 19px;
|
16
|
-
height: 19px;
|
17
|
-
display:flex;
|
18
|
-
align-items: center;
|
19
|
-
justify-content: center;
|
20
|
-
margin-right: $space_xs;
|
21
|
-
&:hover {
|
22
|
-
background-color: rgba($primary_action, $opacity_3);
|
23
|
-
|
24
|
-
}
|
25
|
-
}
|
26
|
-
}
|
27
6
|
}
|
@@ -14,19 +14,15 @@ type NavItemProps = {
|
|
14
14
|
children?: React.ReactNode[] | React.ReactNode,
|
15
15
|
className?: string,
|
16
16
|
collapsible?: boolean,
|
17
|
-
collapsibleClick?: () => void,
|
18
17
|
data?: object,
|
19
18
|
iconLeft?: string,
|
20
19
|
iconRight?: string | string[],
|
21
|
-
iconRightClick?: () => void,
|
22
|
-
iconLeftClick?: () => void,
|
23
20
|
id?: string,
|
24
21
|
imageUrl?: string,
|
25
22
|
link?: string,
|
26
23
|
onClick?: React.MouseEventHandler<HTMLElement>,
|
27
24
|
target?: '_blank' | '_self' | '_parent' | '_top',
|
28
25
|
text: string,
|
29
|
-
toggleCollapsed?: any
|
30
26
|
} & GlobalProps
|
31
27
|
|
32
28
|
const NavItem = (props: NavItemProps) => {
|
@@ -36,34 +32,22 @@ const NavItem = (props: NavItemProps) => {
|
|
36
32
|
children,
|
37
33
|
className,
|
38
34
|
collapsible,
|
39
|
-
collapsibleClick,
|
40
35
|
data = {},
|
41
36
|
iconLeft,
|
42
37
|
iconRight,
|
43
|
-
iconRightClick,
|
44
|
-
iconLeftClick,
|
45
38
|
id,
|
46
39
|
imageUrl,
|
47
40
|
link,
|
48
41
|
onClick = () => { },
|
49
42
|
target = '_self',
|
50
43
|
text = '',
|
51
|
-
toggleCollapsed
|
52
44
|
} = props
|
53
45
|
|
54
46
|
const Tag = link ? 'a' : 'div'
|
55
47
|
const activeClass = active === true ? 'active' : ''
|
56
48
|
const ariaProps = buildAriaProps(aria)
|
57
49
|
const dataProps = buildDataProps(data)
|
58
|
-
const classes = classnames(buildCss('pb_nav_list_kit_item', activeClass),
|
59
|
-
|
60
|
-
|
61
|
-
const handleIconClick = (e:any) => {
|
62
|
-
if (iconLeftClick) {
|
63
|
-
e.stopPropagation();
|
64
|
-
iconLeftClick()
|
65
|
-
}
|
66
|
-
}
|
50
|
+
const classes = classnames(buildCss('pb_nav_list_kit_item', activeClass), globalProps(props), className)
|
67
51
|
|
68
52
|
return (
|
69
53
|
<li
|
@@ -74,13 +58,7 @@ const NavItem = (props: NavItemProps) => {
|
|
74
58
|
>
|
75
59
|
{
|
76
60
|
collapsible ? (
|
77
|
-
<Collapsible icon={iconRight ? iconRight : ['plus','minus']}
|
78
|
-
iconSize="xs"
|
79
|
-
id={id}
|
80
|
-
collapsed={toggleCollapsed}
|
81
|
-
iconClick={iconRightClick}
|
82
|
-
onClick={collapsibleClick}
|
83
|
-
>
|
61
|
+
<Collapsible icon={iconRight ? iconRight : ['plus','minus']} iconSize="xs">
|
84
62
|
<Collapsible.Main>
|
85
63
|
<Tag
|
86
64
|
className="pb_nav_list_item_link"
|
@@ -92,7 +70,6 @@ const NavItem = (props: NavItemProps) => {
|
|
92
70
|
<div
|
93
71
|
className="pb_nav_list_item_icon_section"
|
94
72
|
key={imageUrl}
|
95
|
-
onClick={(e)=>handleIconClick(e)}
|
96
73
|
>
|
97
74
|
<Image
|
98
75
|
className="pb_nav_img_wrapper"
|
@@ -105,7 +82,6 @@ const NavItem = (props: NavItemProps) => {
|
|
105
82
|
<div
|
106
83
|
className="pb_nav_list_item_icon_section"
|
107
84
|
key={iconLeft}
|
108
|
-
onClick={(e)=>handleIconClick(e)}
|
109
85
|
>
|
110
86
|
<Icon
|
111
87
|
className="pb_nav_list_item_icon_left"
|
@@ -1,63 +1,83 @@
|
|
1
|
-
import React from "react"
|
2
|
-
import { Nav, NavItem, useCollapsible } from "../.."
|
3
|
-
|
4
|
-
const CollapsibleNav = (props) => {
|
5
|
-
const navItems = ["Overview", "Albums", "Similar Artists"]
|
6
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
7
|
-
const collapsibles = navItems.map(() => useCollapsible(true))
|
8
|
-
|
9
|
-
const handleMainClick = (index) => {
|
10
|
-
collapsibles.forEach(([, , setCollapsed], idx) => {
|
11
|
-
if (idx === index) {
|
12
|
-
setCollapsed(false)
|
13
|
-
} else {
|
14
|
-
setCollapsed(true)
|
15
|
-
}
|
16
|
-
})
|
17
|
-
}
|
1
|
+
import React from "react";
|
18
2
|
|
3
|
+
import Nav from "../_nav";
|
4
|
+
import NavItem from "../_item";
|
19
5
|
|
20
|
-
|
21
|
-
const [isCollapsed, setCollapsed] = collapsibles[index]
|
22
|
-
setCollapsed(!isCollapsed)
|
23
|
-
}
|
24
|
-
|
6
|
+
const CollapsibleNav = (props) => {
|
25
7
|
return (
|
26
|
-
|
27
|
-
<
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
}
|
8
|
+
<Nav variant="subtle">
|
9
|
+
<NavItem
|
10
|
+
collapsible
|
11
|
+
iconLeft="city"
|
12
|
+
link="#"
|
13
|
+
text="Overview"
|
14
|
+
{...props}
|
15
|
+
>
|
16
|
+
<NavItem
|
17
|
+
link="#"
|
18
|
+
text="City"
|
19
|
+
{...props}
|
20
|
+
/>
|
21
|
+
<NavItem
|
22
|
+
link="#"
|
23
|
+
text="People"
|
24
|
+
{...props}
|
25
|
+
/>
|
26
|
+
<NavItem
|
27
|
+
link="#"
|
28
|
+
text="Business"
|
29
|
+
{...props}
|
30
|
+
/>
|
31
|
+
</NavItem>
|
32
|
+
<NavItem
|
33
|
+
active
|
34
|
+
collapsible
|
35
|
+
iconLeft="theater-masks"
|
36
|
+
link="#"
|
37
|
+
text="Albums"
|
38
|
+
{...props}
|
39
|
+
>
|
40
|
+
<NavItem
|
41
|
+
link="#"
|
42
|
+
text="Entertainment"
|
43
|
+
{...props}
|
44
|
+
/>
|
45
|
+
<NavItem
|
46
|
+
link="#"
|
47
|
+
text="Food"
|
48
|
+
{...props}
|
49
|
+
/>
|
50
|
+
<NavItem
|
51
|
+
link="#"
|
52
|
+
text="Style"
|
53
|
+
{...props}
|
54
|
+
/>
|
55
|
+
</NavItem>
|
56
|
+
<NavItem
|
57
|
+
collapsible
|
58
|
+
iconLeft="city"
|
59
|
+
link="#"
|
60
|
+
text="Similar Artists"
|
61
|
+
{...props}
|
62
|
+
>
|
63
|
+
<NavItem
|
64
|
+
link="#"
|
65
|
+
text="City"
|
66
|
+
{...props}
|
67
|
+
/>
|
68
|
+
<NavItem
|
69
|
+
link="#"
|
70
|
+
text="People"
|
71
|
+
{...props}
|
72
|
+
/>
|
73
|
+
<NavItem
|
74
|
+
link="#"
|
75
|
+
text="Business"
|
76
|
+
{...props}
|
77
|
+
/>
|
78
|
+
</NavItem>
|
79
|
+
</Nav>
|
80
|
+
);
|
81
|
+
};
|
62
82
|
|
63
|
-
export default CollapsibleNav
|
83
|
+
export default CollapsibleNav;
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
|
-
|
2
|
+
|
3
|
+
import Nav from "../_nav";
|
4
|
+
import NavItem from "../_item";
|
3
5
|
|
4
6
|
const CollapsibleNavCustomIcons = (props) => {
|
5
7
|
return (
|
@@ -7,7 +9,7 @@ const CollapsibleNavCustomIcons = (props) => {
|
|
7
9
|
<NavItem
|
8
10
|
collapsible
|
9
11
|
iconLeft="city"
|
10
|
-
iconRight={["
|
12
|
+
iconRight={["chevron-down", "chevron-up"]}
|
11
13
|
link="#"
|
12
14
|
text="Overview"
|
13
15
|
{...props}
|
@@ -32,7 +34,7 @@ const CollapsibleNavCustomIcons = (props) => {
|
|
32
34
|
active
|
33
35
|
collapsible
|
34
36
|
iconLeft="theater-masks"
|
35
|
-
iconRight={["
|
37
|
+
iconRight={["chevron-down", "chevron-up"]}
|
36
38
|
link="#"
|
37
39
|
text="Albums"
|
38
40
|
{...props}
|
@@ -56,7 +58,7 @@ const CollapsibleNavCustomIcons = (props) => {
|
|
56
58
|
<NavItem
|
57
59
|
collapsible
|
58
60
|
iconLeft="city"
|
59
|
-
iconRight={["
|
61
|
+
iconRight={["chevron-down", "chevron-up"]}
|
60
62
|
link="#"
|
61
63
|
text="Similar Artists"
|
62
64
|
{...props}
|
@@ -25,8 +25,8 @@ examples:
|
|
25
25
|
- borderless_nav: No Borders
|
26
26
|
- subtle_nav: Subtle Variant
|
27
27
|
- subtle_with_icons_nav: Subtle With Icons
|
28
|
-
- collapsible_nav: Subtle With Collapsible
|
29
|
-
- collapsible_nav_custom_icons: Subtle With Collapsible (
|
28
|
+
# - collapsible_nav: Subtle With Collapsible
|
29
|
+
# - collapsible_nav_custom_icons: Subtle With Collapsible (Custom Toggle Icons)
|
30
30
|
- subtle_no_highlight_nav: Subtle No Highlight
|
31
31
|
- bold_vertical_nav: Bold Variant
|
32
32
|
- horizontal_nav: Horizontal Nav
|
@@ -14,11 +14,7 @@ module Playbook
|
|
14
14
|
values: %w[_blank _self _parent _top],
|
15
15
|
default: "_self"
|
16
16
|
def classname
|
17
|
-
|
18
|
-
"pb_collapsible_nav_item #{generate_classname('pb_nav_list_kit_item', active_class)}"
|
19
|
-
else
|
20
|
-
generate_classname("pb_nav_list_kit_item", active_class)
|
21
|
-
end
|
17
|
+
generate_classname("pb_nav_list_kit_item", active_class)
|
22
18
|
end
|
23
19
|
|
24
20
|
def tag
|