imbric-theme 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. package/atoms/Button/Button.stories.js +1 -1
  2. package/atoms/Button/__snapshots__/Button.stories.js.snap +8 -8
  3. package/atoms/Heading/Heading.stories.js +2 -2
  4. package/atoms/Heading/__snapshots__/Heading.stories.js.snap +16 -16
  5. package/atoms/Paragraph/Paragraph.stories.js +2 -2
  6. package/atoms/Paragraph/__snapshots__/Paragraph.stories.js.snap +16 -16
  7. package/atoms/Tab/Tab.js +41 -0
  8. package/atoms/Tab/Tab.module.css +17 -0
  9. package/atoms/Tab/Tab.stories.js +27 -0
  10. package/atoms/Tab/constants.js +1 -0
  11. package/atoms/Tab/index.js +3 -0
  12. package/index.js +3 -0
  13. package/layout/FlexColumnContent/FlexColumnContent.js +26 -0
  14. package/layout/FlexColumnContent/FlexColumnContent.module.css +5 -0
  15. package/layout/FlexColumnContent/FlexColumnContent.stories.js +28 -0
  16. package/layout/FlexColumnContent/constants.js +1 -0
  17. package/layout/FlexColumnContent/index.js +3 -0
  18. package/layout/Navbar/Navbar.js +55 -10
  19. package/layout/Navbar/Navbar.module.css +3 -2
  20. package/layout/Navbar/Navbar.stories.js +1 -4
  21. package/layout/Sidebar/Sidebar.js +16 -21
  22. package/layout/Sidebar/Sidebar.module.css +42 -6
  23. package/layout/Sidebar/Sidebar.stories.js +3 -2
  24. package/layout/Sidebar/constants.js +14 -26
  25. package/layout/Sidebar/index.js +1 -2
  26. package/molecules/ItemMenu/ItemMenu.js +27 -19
  27. package/molecules/ItemMenu/ItemMenu.module.css +1 -25
  28. package/molecules/ItemMenu/ItemMenu.stories.js +1 -0
  29. package/molecules/Tabs/Tabs.js +53 -0
  30. package/molecules/Tabs/Tabs.module.css +12 -0
  31. package/molecules/Tabs/Tabs.stories.js +34 -0
  32. package/molecules/Tabs/constants.js +29 -0
  33. package/molecules/Tabs/index.js +3 -0
  34. package/package.json +4 -2
  35. package/styles/globals.css +5 -0
  36. package/layout/Sidebar/Sidebar.css +0 -90
  37. package/storybook-static/0.89e7d77f4d365594e982.manager.bundle.js +0 -1
  38. package/storybook-static/0.e189f835.iframe.bundle.js +0 -3
  39. package/storybook-static/0.e189f835.iframe.bundle.js.LICENSE.txt +0 -8
  40. package/storybook-static/0.e189f835.iframe.bundle.js.map +0 -1
  41. package/storybook-static/1.45d0d6aa.iframe.bundle.js +0 -3
  42. package/storybook-static/1.45d0d6aa.iframe.bundle.js.LICENSE.txt +0 -8
  43. package/storybook-static/1.45d0d6aa.iframe.bundle.js.map +0 -1
  44. package/storybook-static/2.75691da5.iframe.bundle.js +0 -1
  45. package/storybook-static/3.08d15cf4.iframe.bundle.js +0 -1
  46. package/storybook-static/4.cbd8fb943995f84e5583.manager.bundle.js +0 -2
  47. package/storybook-static/4.cbd8fb943995f84e5583.manager.bundle.js.LICENSE.txt +0 -8
  48. package/storybook-static/5.d02ab9a798461caeb506.manager.bundle.js +0 -1
  49. package/storybook-static/6.4deac86378225189a26c.manager.bundle.js +0 -2
  50. package/storybook-static/6.4deac86378225189a26c.manager.bundle.js.LICENSE.txt +0 -12
  51. package/storybook-static/7.20dbe97831bee4cf4ce4.manager.bundle.js +0 -1
  52. package/storybook-static/7.53d57a3d.iframe.bundle.js +0 -1
  53. package/storybook-static/8.33a6bfc3865ab87fcc57.manager.bundle.js +0 -1
  54. package/storybook-static/8.9b339902.iframe.bundle.js +0 -3
  55. package/storybook-static/8.9b339902.iframe.bundle.js.LICENSE.txt +0 -12
  56. package/storybook-static/8.9b339902.iframe.bundle.js.map +0 -1
  57. package/storybook-static/9.f9389e45.iframe.bundle.js +0 -1
  58. package/storybook-static/favicon.ico +0 -0
  59. package/storybook-static/iframe.html +0 -348
  60. package/storybook-static/index.html +0 -59
  61. package/storybook-static/main.45162e1b.iframe.bundle.js +0 -1
  62. package/storybook-static/main.e8773e46a6d316c46694.manager.bundle.js +0 -1
  63. package/storybook-static/runtime~main.9b3271f5.iframe.bundle.js +0 -1
  64. package/storybook-static/runtime~main.d0af9adf44459dbc718a.manager.bundle.js +0 -1
  65. package/storybook-static/static/logo.svg +0 -19
  66. package/storybook-static/static/logotipo.svg +0 -50
  67. package/storybook-static/static/logotipoS.svg +0 -26
  68. package/storybook-static/vendors~main.02332eca.iframe.bundle.js +0 -3
  69. package/storybook-static/vendors~main.02332eca.iframe.bundle.js.LICENSE.txt +0 -107
  70. package/storybook-static/vendors~main.02332eca.iframe.bundle.js.map +0 -1
  71. package/storybook-static/vendors~main.29dce51cb06d0354d6c9.manager.bundle.js +0 -2
  72. package/storybook-static/vendors~main.29dce51cb06d0354d6c9.manager.bundle.js.LICENSE.txt +0 -101
@@ -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' },
@@ -11,21 +11,13 @@ import Icon from '../../atoms/Icon'
11
11
  import Divider from '../../atoms/Divider'
12
12
  import ItemMenu from '../../molecules/ItemMenu/ItemMenu'
13
13
 
14
- export const Sidebar = ({ getStyles }) => {
14
+ export const Sidebar = ({ getStyles, menuCollapseView }) => {
15
15
 
16
- //create initial menuCollapse state using useState hook
17
- const [menuCollapse, setMenuCollapse] = useState(false)
18
-
19
- //create a custom function that will change menucollapse state from false to true and true to false
20
- const menuIconClick = () => {
21
- //condition checking to change state from true to false and vice versa
22
- menuCollapse ? setMenuCollapse(false) : setMenuCollapse(true);
23
- };
24
16
 
25
17
  return (
26
18
  <>
27
19
  <div className={getStyles('header', {
28
- 'collapsed': menuCollapse,
20
+ 'collapsed': menuCollapseView,
29
21
  })}>
30
22
 
31
23
  <div className={getStyles('pro-sidebar')}>
@@ -37,25 +29,25 @@ export const Sidebar = ({ getStyles }) => {
37
29
  <div className={getStyles('pro-sidebar-header')}>
38
30
 
39
31
  <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>}
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>}
42
34
  </div>
43
- <div className={getStyles('closemenu')} onClick={menuIconClick}>
44
- {/* changing menu collapse icon on click */}
45
- {menuCollapse ? (
35
+ {/* <div className={getStyles('closemenu')}>
36
+
37
+ {menuCollapseView ? (
46
38
 
47
39
  <Icon
48
40
  name="angleRight"
49
- onClick={function noRefCheck() { }}
41
+ onClick={menuIconClick}
50
42
  />
51
43
 
52
44
  ) : (
53
45
  <Icon
54
46
  name="angleLeft"
55
- onClick={function noRefCheck() { }}
47
+ onClick={menuIconClick}
56
48
  />
57
49
  )}
58
- </div>
50
+ </div> */}
59
51
 
60
52
  </div>
61
53
 
@@ -65,17 +57,19 @@ export const Sidebar = ({ getStyles }) => {
65
57
 
66
58
  <ul>
67
59
 
68
- {options.itemsMenu.map((item) => (
60
+ {options.itemsMenu.map((item, index) => (
69
61
  item.view ?
70
62
  <ItemMenu
63
+ key={index}
71
64
  icon={item.icon}
72
- subMenu={item.submenu}
65
+ subMenu={item.viewSubMenu}
73
66
  itemSubmenu={item.submenu}
74
67
  >
75
68
  {item.text}
76
69
  </ItemMenu>
70
+
77
71
  : null
78
-
72
+
79
73
  ))}
80
74
 
81
75
  </ul>
@@ -107,6 +101,7 @@ Sidebar.propTypes = {
107
101
 
108
102
  Sidebar.defaultProps = {
109
103
  getStyles: () => { },
104
+ menuCollapseView: false,
110
105
  }
111
106
 
112
107
  export default withStyles(styles)(Sidebar)
@@ -34,8 +34,9 @@
34
34
  }
35
35
 
36
36
  .header {
37
- position: absolute;
38
37
  width: 220px;
38
+ /* position: fixed;
39
+ padding-top: 43px; */
39
40
  }
40
41
 
41
42
  .pro-sidebar {
@@ -67,7 +68,7 @@
67
68
  }
68
69
 
69
70
  .logotext {
70
- padding: 8px 20px;
71
+ padding: 13px 20px;
71
72
  }
72
73
 
73
74
  .closemenu {
@@ -79,7 +80,7 @@
79
80
  border-radius: 50%;
80
81
  font-weight: bold;
81
82
  font-size: 22px;
82
- top: 8px;
83
+ top: 4px;
83
84
  cursor: pointer;
84
85
  }
85
86
 
@@ -93,6 +94,7 @@
93
94
 
94
95
  .pro-sidebar-content {
95
96
  flex-grow: 1;
97
+ margin-top: 38px;
96
98
  }
97
99
 
98
100
  .pro-sidebar-inner .pro-sidebar-layout ul {
@@ -107,11 +109,11 @@
107
109
  padding: 20px;
108
110
  }
109
111
 
110
- @media only screen and (max-width: 720px) {
112
+ /* @media only screen and (max-width: 720px) {
111
113
  html {
112
114
  overflow: hidden;
113
115
  }
114
- }
116
+ } */
115
117
 
116
118
  /* /////////// */
117
119
 
@@ -125,8 +127,12 @@
125
127
  z-index: 101;
126
128
  }
127
129
 
128
- .pro-sidebar>.pro-sidebar-inner>.pro-sidebar-layout .pro-sidebar-header {
130
+ .pro-sidebar-header {
129
131
  border-bottom: 1px solid rgba(173, 173, 173, 0.2);
132
+ position: fixed;
133
+ background-color: #fff;
134
+ width: 220px;
135
+ z-index: 1;
130
136
  }
131
137
 
132
138
  .pro-sidebar>.pro-sidebar-inner>.pro-sidebar-layout .pro-sidebar-footer {
@@ -150,11 +156,41 @@
150
156
  display: none;
151
157
  }
152
158
 
159
+ .header.collapsed>.pro-sidebar>.pro-sidebar-inner>.pro-sidebar-layout >.pro-sidebar-header {
160
+ width: 80px;
161
+ min-width: 80px;
162
+ }
163
+
153
164
  .pro-sidebar.collapsed {
154
165
  width: 80px;
155
166
  min-width: 80px;
156
167
  }
157
168
 
169
+
170
+ .pro-menu {
171
+ padding-top: 10px;
172
+ padding-bottom: 40px;
173
+ }
174
+
175
+ .pro-menu a {
176
+ text-decoration: none;
177
+ color: #adadad;
178
+ }
179
+
180
+ .pro-menu a:before {
181
+ content: '';
182
+ position: absolute;
183
+ top: 0;
184
+ right: 0;
185
+ bottom: 0;
186
+ left: 0;
187
+ background-color: transparent;
188
+ }
189
+
190
+ .pro-menu a:hover {
191
+ color: #d8d8d8;
192
+ }
193
+
158
194
  @media (max-width: 480px) {
159
195
  .pro-sidebar.xs {
160
196
  position: fixed;
@@ -9,7 +9,8 @@ export default {
9
9
  title: 'Layout/Sidebar',
10
10
  component: Sidebar,
11
11
  args: {
12
- options: options.itemsMenu
12
+ options: options.itemsMenu,
13
+ menuCollapseView: false,
13
14
  },
14
15
  argTypes: {
15
16
  options: {
@@ -17,7 +18,7 @@ export default {
17
18
  table: {
18
19
  type: {
19
20
  summary: 'object',
20
- detail: "{ text: 'string', view: 'bool'}",
21
+ detail: "{ text: 'string', icon: 'string', href: 'string', view: 'bool', viewSubMenu: 'bool'}",
21
22
  },
22
23
  },
23
24
  },
@@ -1,22 +1,3 @@
1
- export const subItems = {
2
-
3
- subItemsLegal: [
4
- {
5
- href: 'https://www.imbric.com/privacypolicy/',
6
- title: 'Privacy policy',
7
- },
8
- {
9
- href: 'https://www.imbric.com/general-terms/',
10
- title: 'General terms',
11
- },
12
- {
13
- href: 'https://www.imbric.com/particular-terms/',
14
- title: 'Particular terms',
15
- },
16
- ],
17
-
18
- }
19
-
20
1
  export const options = {
21
2
  itemsMenu: [
22
3
  {
@@ -24,12 +5,14 @@ export const options = {
24
5
  icon: "home",
25
6
  href: "/home",
26
7
  view: true,
8
+ viewSubMenu: false,
27
9
  },
28
10
  {
29
11
  text: "Activity",
30
12
  icon: "activity",
31
13
  href: "/home",
32
14
  view: true,
15
+ viewSubMenu: true,
33
16
  submenu: [
34
17
  {
35
18
  text: "Taxi",
@@ -63,6 +46,7 @@ export const options = {
63
46
  icon: "staff",
64
47
  href: "/home",
65
48
  view: true,
49
+ viewSubMenu: true,
66
50
  submenu: [
67
51
  {
68
52
  text: "People Add",
@@ -87,20 +71,21 @@ export const options = {
87
71
  icon: "travelPrograms",
88
72
  href: "/home",
89
73
  view: true,
90
-
74
+ viewSubMenu: false,
91
75
  },
92
76
  {
93
77
  text: "Billing",
94
78
  icon: "billing",
95
79
  href: "/home",
96
80
  view: true,
97
-
81
+ viewSubMenu: false,
98
82
  },
99
83
  {
100
84
  text: "Setting",
101
85
  icon: "setting",
102
86
  href: "/home",
103
87
  view: true,
88
+ viewSubMenu: true,
104
89
  submenu: [
105
90
  {
106
91
  text: "Company",
@@ -121,27 +106,28 @@ export const options = {
121
106
  icon: "orderTaxi",
122
107
  href: "/home",
123
108
  view: true,
124
-
109
+ viewSubMenu: false,
125
110
  },
126
111
  {
127
112
  text: "Dashboards",
128
113
  icon: "dashboardsUwa",
129
114
  href: "/home",
130
115
  view: true,
131
-
116
+ viewSubMenu: false,
132
117
  },
133
118
  {
134
119
  text: "Projects",
135
120
  icon: "projectsUwa",
136
121
  href: "/home",
137
122
  view: true,
138
-
123
+ viewSubMenu: false,
139
124
  },
140
125
  {
141
126
  text: "Permissions",
142
127
  icon: "permissions",
143
128
  href: "/home",
144
129
  view: true,
130
+ viewSubMenu: true,
145
131
  submenu: [
146
132
  {
147
133
  text: "Permissions",
@@ -156,6 +142,7 @@ export const options = {
156
142
  icon: "analytics",
157
143
  href: "/home",
158
144
  view: true,
145
+ viewSubMenu: true,
159
146
  submenu: [
160
147
  {
161
148
  text: "Dashboard",
@@ -179,6 +166,7 @@ export const options = {
179
166
  icon: "legal",
180
167
  href: "/home",
181
168
  view: true,
169
+ viewSubMenu: true,
182
170
  submenu: [
183
171
  {
184
172
  text: "Privacy policy",
@@ -203,14 +191,14 @@ export const options = {
203
191
  icon: "info",
204
192
  href: "/home",
205
193
  view: true,
206
-
194
+ viewSubMenu: false,
207
195
  },
208
196
  {
209
197
  text: "My profile",
210
198
  icon: "profile",
211
199
  href: "/home",
212
200
  view: true,
213
-
201
+ viewSubMenu: false,
214
202
  },
215
203
  ],
216
204
 
@@ -1,4 +1,3 @@
1
1
  export { default, Sidebar } from './Sidebar'
2
- export { subItems, options } from './constants'
2
+ export { options } from './constants'
3
3
  export { default as styles } from './Sidebar.module.css'
4
- export { default as SidebarCss } from './Sidebar.css'
@@ -5,9 +5,12 @@ import styles from './ItemMenu.module.css'
5
5
  import { options } from './constants'
6
6
  import withStyles from '../../hocs/withStyles'
7
7
 
8
+ import { Link, Route, BrowserRouter } from 'react-router-dom'
9
+
8
10
  import Icon from '../../atoms/Icon'
9
11
 
10
- export const ItemMenu = ({ children, getStyles, size, icon, color, background, subMenu, itemSubmenu }) => {
12
+
13
+ export const ItemMenu = ({ children, getStyles, size, icon, color, background, subMenu, itemSubmenu, toHref }) => {
11
14
 
12
15
  //create initial menuCollapse state using useState hook
13
16
  const [subMenuCollapse, setSubMenuCollapse] = useState(false)
@@ -22,29 +25,33 @@ export const ItemMenu = ({ children, getStyles, size, icon, color, background, s
22
25
  if (!subMenu) {
23
26
  return (
24
27
  <>
25
- <li className={getStyles('pro-menu-item')}>
28
+ <BrowserRouter>
29
+ <Link to={toHref}>
30
+ <li className={getStyles('pro-menu-item')}>
26
31
 
27
- <div className={getStyles('pro-inner-item')}>
32
+ <div className={getStyles('pro-inner-item')}>
28
33
 
29
- <span className={getStyles('pro-icon-wrapper')}>
34
+ <span className={getStyles('pro-icon-wrapper')}>
30
35
 
31
- <span className={getStyles('pro-icon')}>
32
- <Icon
33
- size={size}
34
- name={icon}
35
- color={color}
36
- background={background}
37
- onClick={function noRefCheck() { }}
38
- />
39
- </span>
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>
40
45
 
41
- </span>
46
+ </span>
42
47
 
43
- <span className={getStyles('pro-item-content', { 'color': color })}>{children}</span>
48
+ <span className={getStyles('pro-item-content', { 'color': color })}>{children}</span>
44
49
 
45
- </div>
50
+ </div>
46
51
 
47
- </li>
52
+ </li>
53
+ </Link>
54
+ </BrowserRouter>
48
55
  </>
49
56
  )
50
57
  } else {
@@ -80,8 +87,8 @@ export const ItemMenu = ({ children, getStyles, size, icon, color, background, s
80
87
  <div>
81
88
  <ul>
82
89
 
83
- {itemSubmenu.map((item) => (
84
- <li className={getStyles('pro-menu-item')} href={item.href}>
90
+ {itemSubmenu.map((item, index) => (
91
+ <li key={index} className={getStyles('pro-menu-item')} href={item.href}>
85
92
  <div className={getStyles('pro-inner-item')} role="button">
86
93
  <span className={getStyles('pro-item-content')}>{item.text}</span></div>
87
94
  </li>
@@ -110,6 +117,7 @@ ItemMenu.propTypes = {
110
117
 
111
118
  ItemMenu.defaultProps = {
112
119
  subMenu: false,
120
+ toHref: '/',
113
121
  icon: 'home',
114
122
  size: 'lg',
115
123
  color: 'highlight',
@@ -30,7 +30,7 @@
30
30
  }
31
31
 
32
32
  .pro-menu-item {
33
- font-size: 15px;
33
+ font-size: var(--font-size-base);
34
34
  list-style: none;
35
35
  }
36
36
 
@@ -324,11 +324,6 @@
324
324
  transition-property: none;
325
325
  }
326
326
 
327
- .pro-menu {
328
- padding-top: 10px;
329
- padding-bottom: 10px;
330
- }
331
-
332
327
  .pro-sub-menu>.pro-inner-list-item {
333
328
  position: relative;
334
329
  background-color: hsl(0deg 0% 0% / 2%);
@@ -339,25 +334,6 @@
339
334
  padding-bottom: 15px;
340
335
  }
341
336
 
342
- .pro-menu a {
343
- text-decoration: none;
344
- color: #adadad;
345
- }
346
-
347
- .pro-menu a:before {
348
- content: '';
349
- position: absolute;
350
- top: 0;
351
- right: 0;
352
- bottom: 0;
353
- left: 0;
354
- background-color: transparent;
355
- }
356
-
357
- .pro-menu a:hover {
358
- color: #d8d8d8;
359
- }
360
-
361
337
  .popper-arrow {
362
338
  position: absolute;
363
339
  z-index: -1;
@@ -16,6 +16,7 @@ export default {
16
16
  children: 'Home',
17
17
  subMenu: false,
18
18
  itemSubmenu: options.itemSubmenu,
19
+ toHref: '/',
19
20
  },
20
21
  argTypes: {
21
22
  itemSubmenu: {
@@ -0,0 +1,53 @@
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+
4
+ import styles from './Tabs.module.css'
5
+ import { options } from './constants'
6
+ import withStyles from '../../hocs/withStyles'
7
+
8
+ import Tab from '../../atoms/Tab/Tab'
9
+
10
+ export const Tabs = ({ getStyles, viewTabs }) => {
11
+
12
+ if (viewTabs) {
13
+ return (
14
+
15
+ <div className={getStyles('tabs')}>
16
+
17
+ <nav className={getStyles('pro-nav')}>
18
+
19
+ <ul>
20
+
21
+ {options.itemTabs.map((item, index) => (
22
+
23
+ <Tab
24
+ key={index}
25
+ activeTab={false}
26
+ onClick={function noRefCheck() { }}
27
+ viewTab={item.view}
28
+ >
29
+ {item.text}
30
+ </Tab>
31
+
32
+ ))}
33
+
34
+ </ul>
35
+
36
+ </nav>
37
+
38
+ </div>
39
+ )
40
+ } else {
41
+ null
42
+ }
43
+ }
44
+
45
+ Tabs.propTypes = {
46
+ getStyles: PropTypes.func.isRequired,
47
+ }
48
+
49
+ Tabs.defaultProps = {
50
+ getStyles: () => { },
51
+ }
52
+
53
+ export default withStyles(styles)(Tabs)
@@ -0,0 +1,12 @@
1
+ .tabs {
2
+ display: flex;
3
+ margin-left: auto;
4
+ margin-right: auto;
5
+ }
6
+
7
+ .pro-nav ul {
8
+ display: flex;
9
+ justify-content: center;
10
+ align-items: center;
11
+ margin: 0;
12
+ }
@@ -0,0 +1,34 @@
1
+ import { Tabs, styles, options } from '.'
2
+
3
+ import {
4
+ getTemplate,
5
+ getListTemplate,
6
+ getOptionsArgTypes,
7
+ } from '../../helpers/storybook'
8
+
9
+ const Template = getTemplate(Tabs, styles)
10
+ const ListTemplate = getListTemplate(Tabs, styles)
11
+
12
+ export default {
13
+ title: 'Molecules/Tabs',
14
+ component: Tabs,
15
+ args: {
16
+ options: options.itemTabs,
17
+ viewTabs: true,
18
+ },
19
+ argTypes: {
20
+ options: {
21
+ description: '**array of shaped objects:**',
22
+ table: {
23
+ type: {
24
+ summary: 'object',
25
+ detail: "{ text: 'string', icon: 'string', href: 'string', view: 'bool', viewSubMenu: 'bool'}",
26
+ },
27
+ },
28
+ },
29
+ },
30
+ }
31
+
32
+ export const Default = Template.bind({})
33
+ // export const List = ListTemplate.bind({})
34
+ // List.args = { items: options.types.map((type) => ({ type })) }
@@ -0,0 +1,29 @@
1
+ export const options = {
2
+ itemTabs: [
3
+ {
4
+ text: "Taxi",
5
+ href: "/taxi",
6
+ view: true,
7
+ },
8
+ {
9
+ text: "Parking",
10
+ href: "/parking",
11
+ view: true,
12
+ },
13
+ {
14
+ text: "Sharing",
15
+ href: "/sharing",
16
+ view: true,
17
+ },
18
+ {
19
+ text: "T. Publico",
20
+ href: "/sharing",
21
+ view: true,
22
+ },
23
+ {
24
+ text: "Hoja de Km",
25
+ href: "/sharing",
26
+ view: true,
27
+ },
28
+ ],
29
+ }
@@ -0,0 +1,3 @@
1
+ export { default, Tabs } from './Tabs'
2
+ export { options } from './constants'
3
+ export { default as styles } from './Tabs.module.css'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imbric-theme",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Components library IMBRIC",
5
5
  "private": false,
6
6
  "main": "index.js",
@@ -51,7 +51,9 @@
51
51
  "license": "MIT",
52
52
  "dependencies": {
53
53
  "classnames": "2.3.1",
54
- "react-icons": "4.3.1"
54
+ "react-icons": "4.3.1",
55
+ "react-router": "6.3.0",
56
+ "react-router-dom": "6.3.0"
55
57
  },
56
58
  "devDependencies": {
57
59
  "@babel/core": "7.11.6",