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
@@ -3,32 +3,77 @@ import PropTypes from 'prop-types'
3
3
  import styles from './Navbar.module.css'
4
4
  import withStyles from '../../hocs/withStyles'
5
5
 
6
- export const Navbar = ({ getStyles, children, isPlayground }) => {
6
+ import Heading from '../../atoms/Heading/Heading'
7
+ import Tabs from '../../molecules/Tabs/Tabs'
8
+
9
+ export const Navbar = ({ getStyles, isPlayground, children }) => {
7
10
  return (
8
11
  <>
9
- <header className={getStyles('navbar', {
12
+ <header className={getStyles('navbar', {
10
13
  'is-playground': isPlayground,
11
14
  })}>
12
- <div className={getStyles('navbar__title', 'navbar__item')}>Cutco</div>
13
- <div className={getStyles('navbar__item')}>About Us</div>
14
- <div className={getStyles('navbar__item')}>Contact</div>
15
- <div className={getStyles('navbar__item')}>Help</div>
16
- </header>
17
15
 
18
- {/* {children} */}
16
+ <Heading
17
+ color="primary"
18
+ size="sm"
19
+ weight="light"
20
+ isInline
21
+ >
22
+ {children}
23
+ </Heading>
24
+
25
+ <Tabs
26
+ options={[
27
+ {
28
+ href: '/taxi',
29
+ text: 'Taxi',
30
+ view: true
31
+ },
32
+ {
33
+ href: '/parking',
34
+ text: 'Parking',
35
+ view: true
36
+ },
37
+ {
38
+ href: '/sharing',
39
+ text: 'Sharing',
40
+ view: true
41
+ },
42
+ {
43
+ href: '/sharing',
44
+ text: 'T. Publico',
45
+ view: true
46
+ },
47
+ {
48
+ href: '/sharing',
49
+ text: 'Hoja de Km',
50
+ view: true
51
+ }
52
+ ]}
53
+ viewTabs
54
+ />
55
+
56
+
57
+ {/* <div className={getStyles('navbar__title', 'navbar__item')}>Taksee</div> */}
58
+ {/* <div className={getStyles('navbar__item')}>Legal</div>
59
+ <div className={getStyles('navbar__item')}>User Guide</div> */}
60
+ <div className={getStyles('navbar__item')}>Logout</div>
61
+ </header>
62
+
63
+
19
64
  </>
20
65
  )
21
66
  }
22
67
 
23
68
  Navbar.propTypes = {
24
- children: PropTypes.node.isRequired,
25
69
  getStyles: PropTypes.func.isRequired,
70
+ children: PropTypes.string.isRequired,
26
71
  isPlayground: PropTypes.bool,
27
72
  }
28
73
 
29
74
  Navbar.defaultProps = {
30
75
  isPlayground: false,
31
- getStyles: () => {},
76
+ getStyles: () => { },
32
77
  }
33
78
 
34
79
  export default withStyles(styles)(Navbar)
@@ -12,16 +12,17 @@
12
12
  background-color: #FFFFFF;
13
13
  box-shadow: 0px 1px 4px rgb(100 116 139 / 12%);
14
14
  width: calc(100%);
15
+ padding-left: 18px;
15
16
  }
16
17
 
17
18
  .navbar__title {
18
19
  margin-right: auto;
19
20
  font-size: 150%;
20
- padding: 9px 16px;
21
+ padding: 0.67em 1.5em;
21
22
  }
22
23
 
23
24
  .navbar__item {
24
- padding: 9px 16px;
25
+ padding: 0.67em 1.5em;
25
26
  cursor: pointer;
26
27
  vertical-align: middle;
27
28
  }
@@ -9,10 +9,7 @@ export default {
9
9
  component: Navbar,
10
10
  args: {
11
11
  isPlayground: true,
12
- children: `Farthings pulled strain? Half they'll greater land sordid Elessar. Glamdring um 17 13 motion? Creaked fate spawning chief lords loved loveliest ashes Elfs witness. Brook born Caradhras dining raining! Seeing-stones taking unlost working. A wizard is never late, Frodo Baggins. Nor is he early. He arrives precisely when he means to. Oakenshield despite distinct prosperous wields relight dark weighed leader reaches rid honor. Moments poison Sackville-Bagginses echoes dozens fend get. Scales exist apple Gundabad retaken bunch agreeable mantle cannot name's seasoning private.
13
- Brave dry defeats? Remembered unleashed Denethor niceties legacy. Streets cares pretty Brandybucks ostler. Intact dispatch their expenses suffered flaming bacon should Fili? Jacksie begins hallway needed tracked Gondor's wonderful popularity. Seemed ears perfectly Oakenshield's pale fall animals stabs betrayed grumbling? Stuff awake Brandybuck large done. Curse you and all the halflings!
14
- Dared sit torment goes Anárion forgiven west. Summon Bucklebury ship. Terms none Farthings. Tea choose Dwarvish! Leagues gracious carpet payment Brandywine senses very thousand! Don't you leave him, Samwise Gamgee. Firestorm raising Shire reaction mud morninged shines death should! It'll Halflings nab pot drove start. Carpet Lasgalen seen sleepies!
15
- Seeing renown knocked battered contend World shepherd. Roof sautéed kingdom agree curtain lived preparing down material Galion appearance! Faramir one-fourteenth study talked amongst fisherman barren recoil responsible. There is one Dwarf yet in Moria who still draws breath. Boats wait exaggerate guessed Muil usurper suffice. Unspoken swears stands serpent depart Mithril. Ugly threat Dwarf possessions yours homage long-term unmade. Well-earned suffice tapestry tongue piled smoke lacerations talisman helps Dragon-Slayer crown? Blanket shan't dare appearances hours grave Muil.`,
12
+ children: 'Taksee',
16
13
  },
17
14
  argTypes: {
18
15
  children: { control: 'text' },
@@ -2,294 +2,88 @@ 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 { subItems } from './constants'
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, options }) => {
27
-
28
- //create initial menuCollapse state using useState hook
29
- const [menuCollapse, setMenuCollapse] = useState(false)
14
+ export const Sidebar = ({ getStyles, menuCollapseView }) => {
30
15
 
31
- //create a custom function that will change menucollapse state from false to true and true to false
32
- const menuIconClick = () => {
33
- //condition checking to change state from true to false and vice versa
34
- menuCollapse ? setMenuCollapse(false) : setMenuCollapse(true);
35
- };
36
16
 
37
17
  return (
38
18
  <>
39
- <div id="header">
40
- {/* collapsed props to change menu size using menucollapse state */}
41
- <ProSidebar collapsed={menuCollapse}>
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
70
-
71
- })} */}
19
+ <div className={getStyles('header', {
20
+ 'collapsed': menuCollapseView,
21
+ })}>
72
22
 
73
- {options.isHome.view ?
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
- }
23
+ <div className={getStyles('pro-sidebar')}>
83
24
 
84
- <Divider color="highlight" />
25
+ <div className={getStyles('pro-sidebar-inner')}>
85
26
 
86
- {options.isActivity.view ?
87
- <SubMenu
88
- title={'Activity'}
89
- icon={(<Icon color="inverted" name="activity" onClick={function noRefCheck() { }} size="md" />)}
90
- onOpenChange={(open) => {
27
+ <div className={getStyles('pro-sidebar-layout')}>
91
28
 
92
- }}
29
+ <div className={getStyles('pro-sidebar-header')}>
93
30
 
94
- >
95
- {subItems.subItemsActivity.map((item) => (
96
- <MenuItem
97
- key={item.title}
98
- href={item.href}
99
- title={item.title}
100
- >
101
- {item.title}
102
- </MenuItem>
103
- ))}
104
- </SubMenu>
105
- : null
106
- }
31
+ <div className={getStyles('logotext')}>
32
+ {/* small and big change using menuCollapseView state */}
33
+ {menuCollapseView ? <Picture src="/static/logotipoS.svg" width={19}></Picture> : <Picture src="/static/logotipo.svg" width={100}></Picture>}
34
+ </div>
35
+ {/* <div className={getStyles('closemenu')}>
107
36
 
108
- {options.isStaff.view ?
109
- <SubMenu
110
- title={'Staff'}
111
- icon={(<Icon color="inverted" name="staff" onClick={function noRefCheck() { }} size="md" />)}
112
- onOpenChange={(open) => {
37
+ {menuCollapseView ? (
113
38
 
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
- }
39
+ <Icon
40
+ name="angleRight"
41
+ onClick={menuIconClick}
42
+ />
128
43
 
129
- {options.isServices.view ?
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
- }
44
+ ) : (
45
+ <Icon
46
+ name="angleLeft"
47
+ onClick={menuIconClick}
48
+ />
49
+ )}
50
+ </div> */}
149
51
 
150
- {options.isSetting.view ?
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
- }
52
+ </div>
167
53
 
168
- <Divider color="highlight" />
54
+ <div className={getStyles('pro-sidebar-content')}>
169
55
 
170
- {options.isOrderTaxi.view ?
171
- <MenuItem
172
- title={'orderTaxi'}
173
- icon={(<Icon color="inverted" name="orderTaxi" onClick={function noRefCheck() { }} size="lg" />)}
174
- href={'/orderTaxi'}
175
- >
176
- Order Taxi
177
- </MenuItem>
178
- : null
179
- }
56
+ <nav className={getStyles('pro-menu', 'inner-submenu-arrows')}>
180
57
 
181
- <Divider color="highlight" />
58
+ <ul>
182
59
 
183
- {options.isDashboards.view ?
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
- }
60
+ {options.itemsMenu.map((item, index) => (
61
+ item.view ?
62
+ <ItemMenu
63
+ key={index}
64
+ icon={item.icon}
65
+ subMenu={item.viewSubMenu}
66
+ itemSubmenu={item.submenu}
67
+ >
68
+ {item.text}
69
+ </ItemMenu>
70
+
71
+ : null
193
72
 
194
- {options.isProjects.view ?
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
- }
73
+ ))}
204
74
 
205
- {options.isPermissions.view ?
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
- }
75
+ </ul>
222
76
 
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
- }
77
+ </nav>
240
78
 
241
- <Divider color="highlight" />
79
+ </div>
242
80
 
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
- }
81
+ </div>
271
82
 
272
- <Divider color="highlight" />
83
+ </div>
273
84
 
274
- {options.isMyProfile.view ?
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
- }
85
+ </div>
284
86
 
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
87
  </div>
294
88
  </>
295
89
  )
@@ -307,6 +101,7 @@ Sidebar.propTypes = {
307
101
 
308
102
  Sidebar.defaultProps = {
309
103
  getStyles: () => { },
104
+ menuCollapseView: false,
310
105
  }
311
106
 
312
107
  export default withStyles(styles)(Sidebar)