imbric-theme 0.2.7 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.js +0 -1
- package/index.js +1 -1
- package/layout/Sidebar/Sidebar.css +90 -0
- package/layout/Sidebar/Sidebar.js +50 -250
- package/layout/Sidebar/Sidebar.module.css +70 -461
- package/layout/Sidebar/Sidebar.stories.js +2 -58
- package/layout/Sidebar/constants.js +182 -50
- package/layout/Sidebar/index.js +2 -1
- package/molecules/ItemMenu/ItemMenu.js +121 -0
- package/molecules/ItemMenu/ItemMenu.module.css +378 -0
- package/molecules/ItemMenu/ItemMenu.stories.js +40 -0
- package/molecules/ItemMenu/constants.js +33 -0
- package/molecules/ItemMenu/index.js +3 -0
- package/package.json +2 -3
- package/styles/sidebar.css +0 -751
package/.storybook/preview.js
CHANGED
package/index.js
CHANGED
|
@@ -3,7 +3,6 @@ export { default as CenteredContent } from './layout/CenteredContent'
|
|
|
3
3
|
export { default as Container } from './layout/Container'
|
|
4
4
|
export { default as FullHeightContent } from './layout/FullHeightContent'
|
|
5
5
|
export { default as Spacer } from './layout/Spacer'
|
|
6
|
-
export { default as Navbar } from './layout/Navbar'
|
|
7
6
|
export { default as Sidebar } from './layout/Sidebar'
|
|
8
7
|
|
|
9
8
|
// Atoms
|
|
@@ -31,3 +30,4 @@ export { default as Score } from './molecules/Score'
|
|
|
31
30
|
export { default as Task } from './molecules/Task'
|
|
32
31
|
export { default as TaskCounter } from './molecules/TaskCounter'
|
|
33
32
|
export { default as IconLabel } from './molecules/IconLabel'
|
|
33
|
+
export { default as ItemMenu } from './molecules/ItemMenu'
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
.is-home {
|
|
2
|
+
display: none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
#header {
|
|
6
|
+
position: absolute;
|
|
7
|
+
width: 220px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
#header .pro-sidebar {
|
|
11
|
+
height: 100vh;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
#header .closemenu {
|
|
15
|
+
color: var(--color-primary);
|
|
16
|
+
position: absolute;
|
|
17
|
+
right: -7px;
|
|
18
|
+
z-index: 9999;
|
|
19
|
+
line-height: 20px;
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
font-weight: bold;
|
|
22
|
+
font-size: 22px;
|
|
23
|
+
top: 8px;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#header .pro-sidebar {
|
|
28
|
+
width: 100%;
|
|
29
|
+
min-width: 100%;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#header .pro-sidebar.collapsed {
|
|
33
|
+
width: 80px;
|
|
34
|
+
min-width: 80px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#header .pro-sidebar-inner {
|
|
38
|
+
background-color: var(--color-base-white);
|
|
39
|
+
box-shadow: 0.5px 0.866px 2px 0px rgba(0, 0, 0, 0.15);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#header .pro-sub-menu > .pro-inner-list-item {
|
|
43
|
+
position: relative;
|
|
44
|
+
background-color: var(--color-brand-hint-of-red);
|
|
45
|
+
padding-left: 44px;
|
|
46
|
+
padding-bottom: 4px;
|
|
47
|
+
padding-top: 4px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#header .pro-sidebar-inner .pro-sidebar-layout::-webkit-scrollbar {
|
|
51
|
+
display: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
#header .pro-sidebar-inner .pro-sidebar-layout .logotext {
|
|
55
|
+
padding: 8px 20px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#header .pro-sidebar-inner .pro-sidebar-layout ul {
|
|
59
|
+
padding: 0 5px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#header .pro-sidebar-inner .pro-sidebar-layout ul .pro-inner-item {
|
|
63
|
+
color: var(--color-font-highlight);
|
|
64
|
+
margin: 6px 0px;
|
|
65
|
+
/* font-weight: bold; */
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#header .pro-sidebar-inner .pro-sidebar-layout ul .pro-inner-item .pro-icon-wrapper {
|
|
69
|
+
background-color: var(--color-brand-eastern-blue);
|
|
70
|
+
/* color: var(--color-font-highlight);
|
|
71
|
+
border-radius: 3px; */
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#header .pro-sidebar-inner .pro-sidebar-layout ul .pro-inner-item .pro-icon-wrapper .pro-item-content {
|
|
75
|
+
color: var(--color-font-highlight);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
#header .pro-sidebar-inner .pro-sidebar-layout .active {
|
|
79
|
+
background-image: linear-gradient(0deg, #fece00 0%, #ffe172 100%);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
#header .logo {
|
|
83
|
+
padding: 20px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media only screen and (max-width: 720px) {
|
|
87
|
+
html {
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -2,28 +2,16 @@ import React, { ReactNode, useRef, useState, useEffect } from 'react'
|
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import withStyles from '../../hocs/withStyles'
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
//import react pro sidebar components
|
|
8
|
-
import {
|
|
9
|
-
ProSidebar,
|
|
10
|
-
Menu,
|
|
11
|
-
MenuItem,
|
|
12
|
-
SubMenu,
|
|
13
|
-
SidebarHeader,
|
|
14
|
-
SidebarFooter,
|
|
15
|
-
SidebarContent,
|
|
16
|
-
} from "react-pro-sidebar"
|
|
5
|
+
import { options } from './constants'
|
|
17
6
|
|
|
18
7
|
import styles from './Sidebar.module.css'
|
|
19
|
-
//import sidebar css from react-pro-sidebar module and our custom css
|
|
20
|
-
// import "react-pro-sidebar/dist/css/styles.css"
|
|
21
8
|
|
|
22
9
|
import Picture from '../../atoms/Picture'
|
|
23
10
|
import Icon from '../../atoms/Icon'
|
|
24
11
|
import Divider from '../../atoms/Divider'
|
|
12
|
+
import ItemMenu from '../../molecules/ItemMenu/ItemMenu'
|
|
25
13
|
|
|
26
|
-
export const Sidebar = ({ getStyles
|
|
14
|
+
export const Sidebar = ({ getStyles }) => {
|
|
27
15
|
|
|
28
16
|
//create initial menuCollapse state using useState hook
|
|
29
17
|
const [menuCollapse, setMenuCollapse] = useState(false)
|
|
@@ -36,260 +24,72 @@ export const Sidebar = ({ getStyles, options }) => {
|
|
|
36
24
|
|
|
37
25
|
return (
|
|
38
26
|
<>
|
|
39
|
-
<div
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<SidebarHeader>
|
|
43
|
-
<div className="logotext">
|
|
44
|
-
{/* small and big change using menucollapse state */}
|
|
45
|
-
{/* <p>{menuCollapse ? "Logo" : "Big Logo"}</p> */}
|
|
46
|
-
{menuCollapse ? <Picture src="/static/logotipoS.svg" width={30}></Picture> : <Picture src="/static/logotipo.svg" width={120}></Picture>}
|
|
47
|
-
</div>
|
|
48
|
-
<div className="closemenu" onClick={menuIconClick}>
|
|
49
|
-
{/* changing menu collapse icon on click */}
|
|
50
|
-
{menuCollapse ? (
|
|
51
|
-
|
|
52
|
-
<Icon
|
|
53
|
-
name="angleRight"
|
|
54
|
-
onClick={function noRefCheck() { }}
|
|
55
|
-
/>
|
|
56
|
-
|
|
57
|
-
) : (
|
|
58
|
-
<Icon
|
|
59
|
-
name="angleLeft"
|
|
60
|
-
onClick={function noRefCheck() { }}
|
|
61
|
-
/>
|
|
62
|
-
)}
|
|
63
|
-
</div>
|
|
64
|
-
</SidebarHeader>
|
|
65
|
-
<SidebarContent>
|
|
66
|
-
<Menu iconShape="circle">
|
|
67
|
-
|
|
68
|
-
{/* {options.forEach(itemMenu => {
|
|
69
|
-
console.log(itemMenu); //This does ifre
|
|
27
|
+
<div className={getStyles('header', {
|
|
28
|
+
'collapsed': menuCollapse,
|
|
29
|
+
})}>
|
|
70
30
|
|
|
71
|
-
|
|
31
|
+
<div className={getStyles('pro-sidebar')}>
|
|
72
32
|
|
|
73
|
-
|
|
74
|
-
<MenuItem
|
|
75
|
-
title={'Home'}
|
|
76
|
-
icon={(<Icon color="inverted" name="home" onClick={function noRefCheck() { }} size="md" />)}
|
|
77
|
-
href={'/'}
|
|
78
|
-
>
|
|
79
|
-
Home
|
|
80
|
-
</MenuItem>
|
|
81
|
-
: null
|
|
82
|
-
}
|
|
33
|
+
<div className={getStyles('pro-sidebar-inner')}>
|
|
83
34
|
|
|
84
|
-
|
|
35
|
+
<div className={getStyles('pro-sidebar-layout')}>
|
|
85
36
|
|
|
86
|
-
{
|
|
87
|
-
<SubMenu
|
|
88
|
-
title={'Activity'}
|
|
89
|
-
icon={(<Icon color="inverted" name="activity" onClick={function noRefCheck() { }} size="md" />)}
|
|
90
|
-
onOpenChange={(open) => {
|
|
37
|
+
<div className={getStyles('pro-sidebar-header')}>
|
|
91
38
|
|
|
92
|
-
|
|
39
|
+
<div className={getStyles('logotext')}>
|
|
40
|
+
{/* small and big change using menucollapse state */}
|
|
41
|
+
{menuCollapse ? <Picture src="/static/logotipoS.svg" width={30}></Picture> : <Picture src="/static/logotipo.svg" width={120}></Picture>}
|
|
42
|
+
</div>
|
|
43
|
+
<div className={getStyles('closemenu')} onClick={menuIconClick}>
|
|
44
|
+
{/* changing menu collapse icon on click */}
|
|
45
|
+
{menuCollapse ? (
|
|
93
46
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
href={item.href}
|
|
99
|
-
title={item.title}
|
|
100
|
-
>
|
|
101
|
-
{item.title}
|
|
102
|
-
</MenuItem>
|
|
103
|
-
))}
|
|
104
|
-
</SubMenu>
|
|
105
|
-
: null
|
|
106
|
-
}
|
|
47
|
+
<Icon
|
|
48
|
+
name="angleRight"
|
|
49
|
+
onClick={function noRefCheck() { }}
|
|
50
|
+
/>
|
|
107
51
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
52
|
+
) : (
|
|
53
|
+
<Icon
|
|
54
|
+
name="angleLeft"
|
|
55
|
+
onClick={function noRefCheck() { }}
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
113
59
|
|
|
114
|
-
|
|
115
|
-
>
|
|
116
|
-
{subItems.subItemsStaff.map((item) => (
|
|
117
|
-
<MenuItem
|
|
118
|
-
key={item.title}
|
|
119
|
-
href={item.href}
|
|
120
|
-
title={item.title}
|
|
121
|
-
>
|
|
122
|
-
{item.title}
|
|
123
|
-
</MenuItem>
|
|
124
|
-
))}
|
|
125
|
-
</SubMenu>
|
|
126
|
-
: null
|
|
127
|
-
}
|
|
60
|
+
</div>
|
|
128
61
|
|
|
129
|
-
{
|
|
130
|
-
<MenuItem
|
|
131
|
-
title={'Services'}
|
|
132
|
-
icon={(<Icon color="inverted" name="travelPrograms" onClick={function noRefCheck() { }} size="lg" />)}
|
|
133
|
-
href={'/services'}
|
|
134
|
-
>
|
|
135
|
-
Services
|
|
136
|
-
</MenuItem>
|
|
137
|
-
: null
|
|
138
|
-
}
|
|
139
|
-
{options.isBilling.view ?
|
|
140
|
-
<MenuItem
|
|
141
|
-
title={'Billing'}
|
|
142
|
-
icon={(<Icon color="inverted" name="billing" onClick={function noRefCheck() { }} size="md" />)}
|
|
143
|
-
href={'/billing'}
|
|
144
|
-
>
|
|
145
|
-
Billing
|
|
146
|
-
</MenuItem>
|
|
147
|
-
: null
|
|
148
|
-
}
|
|
62
|
+
<div className={getStyles('pro-sidebar-content')}>
|
|
149
63
|
|
|
150
|
-
|
|
151
|
-
<SubMenu
|
|
152
|
-
title={'Setting'}
|
|
153
|
-
icon={(<Icon color="inverted" name="setting" onClick={function noRefCheck() { }} size="md" />)}
|
|
154
|
-
>
|
|
155
|
-
{subItems.subItemsSetting.map((item) => (
|
|
156
|
-
<MenuItem
|
|
157
|
-
key={item.title}
|
|
158
|
-
href={item.href}
|
|
159
|
-
title={item.title}
|
|
160
|
-
>
|
|
161
|
-
{item.title}
|
|
162
|
-
</MenuItem>
|
|
163
|
-
))}
|
|
164
|
-
</SubMenu>
|
|
165
|
-
: null
|
|
166
|
-
}
|
|
64
|
+
<nav className={getStyles('pro-menu', 'inner-submenu-arrows')}>
|
|
167
65
|
|
|
168
|
-
|
|
66
|
+
<ul>
|
|
169
67
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
68
|
+
{options.itemsMenu.map((item) => (
|
|
69
|
+
item.view ?
|
|
70
|
+
<ItemMenu
|
|
71
|
+
icon={item.icon}
|
|
72
|
+
subMenu={item.submenu}
|
|
73
|
+
itemSubmenu={item.submenu}
|
|
74
|
+
>
|
|
75
|
+
{item.text}
|
|
76
|
+
</ItemMenu>
|
|
77
|
+
: null
|
|
78
|
+
|
|
79
|
+
))}
|
|
180
80
|
|
|
181
|
-
|
|
81
|
+
</ul>
|
|
182
82
|
|
|
183
|
-
|
|
184
|
-
<MenuItem
|
|
185
|
-
title={'dashboards'}
|
|
186
|
-
icon={(<Icon color="inverted" name="dashboardsUwa" onClick={function noRefCheck() { }} size="md" />)}
|
|
187
|
-
href={'/dashboards'}
|
|
188
|
-
>
|
|
189
|
-
Dashboards
|
|
190
|
-
</MenuItem>
|
|
191
|
-
: null
|
|
192
|
-
}
|
|
83
|
+
</nav>
|
|
193
84
|
|
|
194
|
-
|
|
195
|
-
<MenuItem
|
|
196
|
-
title={'projects'}
|
|
197
|
-
icon={(<Icon color="inverted" name="projectsUwa" onClick={function noRefCheck() { }} size="md" />)}
|
|
198
|
-
href={'/projects'}
|
|
199
|
-
>
|
|
200
|
-
Projects
|
|
201
|
-
</MenuItem>
|
|
202
|
-
: null
|
|
203
|
-
}
|
|
85
|
+
</div>
|
|
204
86
|
|
|
205
|
-
|
|
206
|
-
<SubMenu
|
|
207
|
-
title={'Permissions'}
|
|
208
|
-
icon={(<Icon color="inverted" name="permissions" onClick={function noRefCheck() { }} size="md" />)}
|
|
209
|
-
>
|
|
210
|
-
{subItems.subItemsPermissions.map((item) => (
|
|
211
|
-
<MenuItem
|
|
212
|
-
key={item.title}
|
|
213
|
-
href={item.href}
|
|
214
|
-
title={item.title}
|
|
215
|
-
>
|
|
216
|
-
{item.title}
|
|
217
|
-
</MenuItem>
|
|
218
|
-
))}
|
|
219
|
-
</SubMenu>
|
|
220
|
-
: null
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
{options.isAnalytics.view ?
|
|
224
|
-
<SubMenu
|
|
225
|
-
title={'Analytics'}
|
|
226
|
-
icon={(<Icon color="inverted" name="analytics" onClick={function noRefCheck() { }} size="md" />)}
|
|
227
|
-
>
|
|
228
|
-
{subItems.subItemsAnalytics.map((item) => (
|
|
229
|
-
<MenuItem
|
|
230
|
-
key={item.title}
|
|
231
|
-
href={item.href}
|
|
232
|
-
title={item.title}
|
|
233
|
-
>
|
|
234
|
-
{item.title}
|
|
235
|
-
</MenuItem>
|
|
236
|
-
))}
|
|
237
|
-
</SubMenu>
|
|
238
|
-
: null
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
<Divider color="highlight" />
|
|
242
|
-
|
|
243
|
-
{options.isLegal.view ?
|
|
244
|
-
<SubMenu
|
|
245
|
-
title={'Legal'}
|
|
246
|
-
icon={(<Icon color="inverted" name="legal" onClick={function noRefCheck() { }} size="md" />)}
|
|
247
|
-
>
|
|
248
|
-
{subItems.subItemsLegal.map((item) => (
|
|
249
|
-
<MenuItem
|
|
250
|
-
key={item.title}
|
|
251
|
-
href={item.href}
|
|
252
|
-
title={item.title}
|
|
253
|
-
>
|
|
254
|
-
{item.title}
|
|
255
|
-
</MenuItem>
|
|
256
|
-
))}
|
|
257
|
-
</SubMenu>
|
|
258
|
-
: null
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
{options.isUserGuide.view ?
|
|
262
|
-
<MenuItem
|
|
263
|
-
title={'UserGuide'}
|
|
264
|
-
icon={(<Icon color="inverted" name="info" onClick={function noRefCheck() { }} size="md" />)}
|
|
265
|
-
href={'/userGuide'}
|
|
266
|
-
>
|
|
267
|
-
User Guide
|
|
268
|
-
</MenuItem>
|
|
269
|
-
: null
|
|
270
|
-
}
|
|
87
|
+
</div>
|
|
271
88
|
|
|
272
|
-
|
|
89
|
+
</div>
|
|
273
90
|
|
|
274
|
-
|
|
275
|
-
<MenuItem
|
|
276
|
-
title={'my-profile'}
|
|
277
|
-
icon={(<Icon color="inverted" name="profile" onClick={function noRefCheck() { }} size="md" />)}
|
|
278
|
-
href={'/my-profile'}
|
|
279
|
-
>
|
|
280
|
-
My profile
|
|
281
|
-
</MenuItem>
|
|
282
|
-
: null
|
|
283
|
-
}
|
|
91
|
+
</div>
|
|
284
92
|
|
|
285
|
-
</Menu>
|
|
286
|
-
</SidebarContent>
|
|
287
|
-
<SidebarFooter>
|
|
288
|
-
<Menu iconShape="circle">
|
|
289
|
-
<MenuItem icon={(<Icon color="inverted" name="logout" onClick={function noRefCheck() { }} size="md" />)}>Logout</MenuItem>
|
|
290
|
-
</Menu>
|
|
291
|
-
</SidebarFooter>
|
|
292
|
-
</ProSidebar>
|
|
293
93
|
</div>
|
|
294
94
|
</>
|
|
295
95
|
)
|