imbric-theme 0.2.8 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. package/.storybook/preview.js +0 -1
  2. package/atoms/Button/Button.stories.js +1 -1
  3. package/atoms/Button/__snapshots__/Button.stories.js.snap +8 -8
  4. package/atoms/Heading/Heading.stories.js +2 -2
  5. package/atoms/Heading/__snapshots__/Heading.stories.js.snap +16 -16
  6. package/atoms/Paragraph/Paragraph.stories.js +2 -2
  7. package/atoms/Paragraph/__snapshots__/Paragraph.stories.js.snap +16 -16
  8. package/atoms/Tab/Tab.js +41 -0
  9. package/atoms/Tab/Tab.module.css +17 -0
  10. package/atoms/Tab/Tab.stories.js +27 -0
  11. package/atoms/Tab/constants.js +1 -0
  12. package/atoms/Tab/index.js +3 -0
  13. package/index.js +4 -1
  14. package/layout/FlexColumnContent/FlexColumnContent.js +26 -0
  15. package/layout/FlexColumnContent/FlexColumnContent.module.css +5 -0
  16. package/layout/FlexColumnContent/FlexColumnContent.stories.js +28 -0
  17. package/layout/FlexColumnContent/constants.js +1 -0
  18. package/layout/FlexColumnContent/index.js +3 -0
  19. package/layout/Navbar/Navbar.js +55 -10
  20. package/layout/Navbar/Navbar.module.css +3 -2
  21. package/layout/Navbar/Navbar.stories.js +1 -4
  22. package/layout/Sidebar/Sidebar.js +51 -256
  23. package/layout/Sidebar/Sidebar.module.css +393 -0
  24. package/layout/Sidebar/Sidebar.stories.js +4 -59
  25. package/layout/Sidebar/constants.js +185 -65
  26. package/layout/Sidebar/index.js +1 -1
  27. package/molecules/ItemMenu/ItemMenu.js +129 -0
  28. package/molecules/ItemMenu/ItemMenu.module.css +354 -0
  29. package/molecules/ItemMenu/ItemMenu.stories.js +41 -0
  30. package/molecules/ItemMenu/constants.js +33 -0
  31. package/molecules/ItemMenu/index.js +3 -0
  32. package/molecules/Tabs/Tabs.js +53 -0
  33. package/molecules/Tabs/Tabs.module.css +12 -0
  34. package/molecules/Tabs/Tabs.stories.js +34 -0
  35. package/molecules/Tabs/constants.js +29 -0
  36. package/molecules/Tabs/index.js +3 -0
  37. package/package.json +3 -2
  38. package/styles/globals.css +5 -0
  39. package/storybook-static/0.89e7d77f4d365594e982.manager.bundle.js +0 -1
  40. package/storybook-static/0.e189f835.iframe.bundle.js +0 -3
  41. package/storybook-static/0.e189f835.iframe.bundle.js.LICENSE.txt +0 -8
  42. package/storybook-static/0.e189f835.iframe.bundle.js.map +0 -1
  43. package/storybook-static/1.45d0d6aa.iframe.bundle.js +0 -3
  44. package/storybook-static/1.45d0d6aa.iframe.bundle.js.LICENSE.txt +0 -8
  45. package/storybook-static/1.45d0d6aa.iframe.bundle.js.map +0 -1
  46. package/storybook-static/2.75691da5.iframe.bundle.js +0 -1
  47. package/storybook-static/3.08d15cf4.iframe.bundle.js +0 -1
  48. package/storybook-static/4.cbd8fb943995f84e5583.manager.bundle.js +0 -2
  49. package/storybook-static/4.cbd8fb943995f84e5583.manager.bundle.js.LICENSE.txt +0 -8
  50. package/storybook-static/5.d02ab9a798461caeb506.manager.bundle.js +0 -1
  51. package/storybook-static/6.4deac86378225189a26c.manager.bundle.js +0 -2
  52. package/storybook-static/6.4deac86378225189a26c.manager.bundle.js.LICENSE.txt +0 -12
  53. package/storybook-static/7.20dbe97831bee4cf4ce4.manager.bundle.js +0 -1
  54. package/storybook-static/7.53d57a3d.iframe.bundle.js +0 -1
  55. package/storybook-static/8.33a6bfc3865ab87fcc57.manager.bundle.js +0 -1
  56. package/storybook-static/8.9b339902.iframe.bundle.js +0 -3
  57. package/storybook-static/8.9b339902.iframe.bundle.js.LICENSE.txt +0 -12
  58. package/storybook-static/8.9b339902.iframe.bundle.js.map +0 -1
  59. package/storybook-static/9.f9389e45.iframe.bundle.js +0 -1
  60. package/storybook-static/favicon.ico +0 -0
  61. package/storybook-static/iframe.html +0 -348
  62. package/storybook-static/index.html +0 -59
  63. package/storybook-static/main.45162e1b.iframe.bundle.js +0 -1
  64. package/storybook-static/main.e8773e46a6d316c46694.manager.bundle.js +0 -1
  65. package/storybook-static/runtime~main.9b3271f5.iframe.bundle.js +0 -1
  66. package/storybook-static/runtime~main.d0af9adf44459dbc718a.manager.bundle.js +0 -1
  67. package/storybook-static/static/logo.svg +0 -19
  68. package/storybook-static/static/logotipo.svg +0 -50
  69. package/storybook-static/static/logotipoS.svg +0 -26
  70. package/storybook-static/vendors~main.02332eca.iframe.bundle.js +0 -3
  71. package/storybook-static/vendors~main.02332eca.iframe.bundle.js.LICENSE.txt +0 -107
  72. package/storybook-static/vendors~main.02332eca.iframe.bundle.js.map +0 -1
  73. package/storybook-static/vendors~main.29dce51cb06d0354d6c9.manager.bundle.js +0 -2
  74. package/storybook-static/vendors~main.29dce51cb06d0354d6c9.manager.bundle.js.LICENSE.txt +0 -101
  75. package/styles/sidebar.css +0 -751
@@ -1,84 +1,204 @@
1
- export const subItems = {
1
+ export const options = {
2
+ itemsMenu: [
3
+ {
4
+ text: "Home",
5
+ icon: "home",
6
+ href: "/home",
7
+ view: true,
8
+ viewSubMenu: false,
9
+ },
10
+ {
11
+ text: "Activity",
12
+ icon: "activity",
13
+ href: "/home",
14
+ view: true,
15
+ viewSubMenu: true,
16
+ submenu: [
17
+ {
18
+ text: "Taxi",
19
+ href: "/taxi",
20
+ view: true,
21
+ },
22
+ {
23
+ text: "Parking",
24
+ href: "/parking",
25
+ view: true,
26
+ },
27
+ {
28
+ text: "Sharing",
29
+ href: "/sharing",
30
+ view: true,
31
+ },
32
+ {
33
+ text: "Public transport",
34
+ href: "/publictransport ",
35
+ view: true,
36
+ },
37
+ {
38
+ text: "Kilometer sheet",
39
+ href: "/kilometersheet",
40
+ view: true,
41
+ }
42
+ ],
43
+ },
44
+ {
45
+ text: "Staff",
46
+ icon: "staff",
47
+ href: "/home",
48
+ view: true,
49
+ viewSubMenu: true,
50
+ submenu: [
51
+ {
52
+ text: "People Add",
53
+ href: "/staff/taxi",
54
+ view: true,
55
+ },
56
+ {
57
+ text: "People View",
58
+ href: "/staff/taxi",
59
+ view: true,
60
+ },
61
+ {
62
+ text: "People Group",
63
+ href: "/staff/taxi",
64
+ view: true,
65
+ },
2
66
 
3
- subItemsActivity: [
4
- {
5
- href: '/activity/taxi',
6
- title: 'Taxi',
7
- },
8
- {
9
- href: '/activity/parking',
10
- title: 'Parking',
11
- },
12
- {
13
- href: '/activity/sharing',
14
- title: 'Sharing',
15
- },
16
- ],
67
+ ],
68
+ },
69
+ {
70
+ text: "Services",
71
+ icon: "travelPrograms",
72
+ href: "/home",
73
+ view: true,
74
+ viewSubMenu: false,
75
+ },
76
+ {
77
+ text: "Billing",
78
+ icon: "billing",
79
+ href: "/home",
80
+ view: true,
81
+ viewSubMenu: false,
82
+ },
83
+ {
84
+ text: "Setting",
85
+ icon: "setting",
86
+ href: "/home",
87
+ view: true,
88
+ viewSubMenu: true,
89
+ submenu: [
90
+ {
91
+ text: "Company",
92
+ href: "/company/edit",
93
+ view: true,
94
+ },
95
+ {
96
+ text: "Wallet",
97
+ href: "/company/wallet",
98
+ view: true,
99
+ },
17
100
 
18
- subItemsStaff: [
19
- {
20
- href: '/staff/taxi',
21
- title: 'People Add',
22
- },
23
- {
24
- href: '/staff/parking',
25
- title: 'People View',
26
- },
27
- {
28
- href: '/staff/sharing',
29
- title: 'People Group',
30
- },
31
- ],
101
+ ],
32
102
 
33
- subItemsSetting: [
34
- {
35
- href: '/staff/taxi',
36
- title: 'People Add',
37
103
  },
38
104
  {
39
- href: '/staff/parking',
40
- title: 'People View',
105
+ text: "Order Taxi",
106
+ icon: "orderTaxi",
107
+ href: "/home",
108
+ view: true,
109
+ viewSubMenu: false,
41
110
  },
42
111
  {
43
- href: '/staff/sharing',
44
- title: 'People Group',
112
+ text: "Dashboards",
113
+ icon: "dashboardsUwa",
114
+ href: "/home",
115
+ view: true,
116
+ viewSubMenu: false,
45
117
  },
46
- ],
47
-
48
- subItemsPermissions: [
49
- {
50
- href: '/permissions/managestaff',
51
- title: 'Permissions',
52
- },
53
- ],
54
-
55
- subItemsAnalytics: [
56
118
  {
57
- href: '/analytics/dashboard',
58
- title: 'Dashboard',
119
+ text: "Projects",
120
+ icon: "projectsUwa",
121
+ href: "/home",
122
+ view: true,
123
+ viewSubMenu: false,
59
124
  },
60
125
  {
61
- href: '/analytics/taxi',
62
- title: 'Taxi',
63
- },
64
- {
65
- href: '/analytics/tollsparking',
66
- title: 'Parking',
67
- },
68
- ],
126
+ text: "Permissions",
127
+ icon: "permissions",
128
+ href: "/home",
129
+ view: true,
130
+ viewSubMenu: true,
131
+ submenu: [
132
+ {
133
+ text: "Permissions",
134
+ href: "/permissions/managestaff",
135
+ view: true,
136
+ },
137
+
138
+ ],
139
+ },
140
+ {
141
+ text: "Analytics",
142
+ icon: "analytics",
143
+ href: "/home",
144
+ view: true,
145
+ viewSubMenu: true,
146
+ submenu: [
147
+ {
148
+ text: "Dashboard",
149
+ href: "/analytics/dashboard",
150
+ view: true,
151
+ },
152
+ {
153
+ text: "Taxi",
154
+ href: "/analytics/taxi",
155
+ view: true,
156
+ },
157
+ {
158
+ text: "Parking",
159
+ href: "/analytics/tollsparking",
160
+ view: true,
161
+ },
162
+ ],
163
+ },
164
+ {
165
+ text: "Legal",
166
+ icon: "legal",
167
+ href: "/home",
168
+ view: true,
169
+ viewSubMenu: true,
170
+ submenu: [
171
+ {
172
+ text: "Privacy policy",
173
+ href: "/legal/dashboard",
174
+ view: true,
175
+ },
176
+ {
177
+ text: "General terms",
178
+ href: "/legal/taxi",
179
+ view: true,
180
+ },
181
+ {
182
+ text: "Particular terms",
183
+ href: "/legal/tollsparking",
184
+ view: true,
185
+ },
186
+ ],
69
187
 
70
- subItemsLegal: [
71
- {
72
- href: 'https://www.imbric.com/privacypolicy/',
73
- title: 'Privacy policy',
74
188
  },
75
189
  {
76
- href: 'https://www.imbric.com/general-terms/',
77
- title: 'General terms',
190
+ text: "User Guide",
191
+ icon: "info",
192
+ href: "/home",
193
+ view: true,
194
+ viewSubMenu: false,
78
195
  },
79
196
  {
80
- href: 'https://www.imbric.com/particular-terms/',
81
- title: 'Particular terms',
197
+ text: "My profile",
198
+ icon: "profile",
199
+ href: "/home",
200
+ view: true,
201
+ viewSubMenu: false,
82
202
  },
83
203
  ],
84
204
 
@@ -1,3 +1,3 @@
1
1
  export { default, Sidebar } from './Sidebar'
2
- export { subItems } from './constants'
2
+ export { options } from './constants'
3
3
  export { default as styles } from './Sidebar.module.css'
@@ -0,0 +1,129 @@
1
+ import React, { useState } from 'react'
2
+ import PropTypes from 'prop-types'
3
+
4
+ import styles from './ItemMenu.module.css'
5
+ import { options } from './constants'
6
+ import withStyles from '../../hocs/withStyles'
7
+
8
+ import { Link, Route, BrowserRouter } from 'react-router-dom'
9
+
10
+ import Icon from '../../atoms/Icon'
11
+
12
+
13
+ export const ItemMenu = ({ children, getStyles, size, icon, color, background, subMenu, itemSubmenu, toHref }) => {
14
+
15
+ //create initial menuCollapse state using useState hook
16
+ const [subMenuCollapse, setSubMenuCollapse] = useState(false)
17
+
18
+ //create a custom function that will change menucollapse state from false to true and true to false
19
+ const subMenuIconClick = () => {
20
+ //condition checking to change state from true to false and vice versa
21
+ subMenuCollapse ? setSubMenuCollapse(false) : setSubMenuCollapse(true);
22
+ };
23
+
24
+
25
+ if (!subMenu) {
26
+ return (
27
+ <>
28
+ <BrowserRouter>
29
+ <Link to={toHref}>
30
+ <li className={getStyles('pro-menu-item')}>
31
+
32
+ <div className={getStyles('pro-inner-item')}>
33
+
34
+ <span className={getStyles('pro-icon-wrapper')}>
35
+
36
+ <span className={getStyles('pro-icon')}>
37
+ <Icon
38
+ size={size}
39
+ name={icon}
40
+ color={color}
41
+ background={background}
42
+ onClick={function noRefCheck() { }}
43
+ />
44
+ </span>
45
+
46
+ </span>
47
+
48
+ <span className={getStyles('pro-item-content', { 'color': color })}>{children}</span>
49
+
50
+ </div>
51
+
52
+ </li>
53
+ </Link>
54
+ </BrowserRouter>
55
+ </>
56
+ )
57
+ } else {
58
+ return (
59
+ <>
60
+ <li className={getStyles('pro-menu-item', 'pro-sub-menu', { 'open': subMenuCollapse })} title="Home" href="/">
61
+
62
+ <div className={getStyles('pro-inner-item')} onClick={subMenuIconClick}>
63
+
64
+ <span className={getStyles('pro-icon-wrapper')}>
65
+
66
+ <span className={getStyles('pro-icon')}>
67
+ <Icon
68
+ size={size}
69
+ name={icon}
70
+ color={color}
71
+ background={background}
72
+ onClick={function noRefCheck() { }}
73
+ />
74
+ </span>
75
+
76
+ </span>
77
+
78
+ <span className={getStyles('pro-item-content', { 'color': color })}>{children}</span>
79
+
80
+ <span className={getStyles('pro-arrow-wrapper')}>
81
+ <span className={getStyles('pro-arrow')}></span>
82
+ </span>
83
+
84
+ </div>
85
+
86
+ <div className={getStyles('react-slidedown', 'pro-inner-list-item', { 'closed': !subMenuCollapse })}>
87
+ <div>
88
+ <ul>
89
+
90
+ {itemSubmenu.map((item, index) => (
91
+ <li key={index} className={getStyles('pro-menu-item')} href={item.href}>
92
+ <div className={getStyles('pro-inner-item')} role="button">
93
+ <span className={getStyles('pro-item-content')}>{item.text}</span></div>
94
+ </li>
95
+ ))}
96
+ </ul>
97
+ </div>
98
+ </div>
99
+
100
+ </li>
101
+ </>
102
+ )
103
+ }
104
+
105
+
106
+ }
107
+
108
+ ItemMenu.propTypes = {
109
+ children: PropTypes.node.isRequired,
110
+ getStyles: PropTypes.func.isRequired,
111
+ subMenu: PropTypes.bool.isRequired,
112
+ icon: PropTypes.oneOf(options.icons),
113
+ size: PropTypes.oneOf(options.sizes),
114
+ color: PropTypes.oneOf(options.colors),
115
+ background: PropTypes.oneOf(options.backgrounds),
116
+ }
117
+
118
+ ItemMenu.defaultProps = {
119
+ subMenu: false,
120
+ toHref: '/',
121
+ icon: 'home',
122
+ size: 'lg',
123
+ color: 'highlight',
124
+ background: 'transparent',
125
+ getStyles: () => { },
126
+ }
127
+
128
+
129
+ export default withStyles(styles)(ItemMenu)