imbric-theme 0.5.7 → 0.5.9

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.
@@ -30,7 +30,7 @@ export const Checkbox = ({
30
30
  setChecked(!checked)
31
31
  onChange(e)
32
32
  }}
33
- onclick={handleClick}
33
+ onClick={handleClick}
34
34
  />
35
35
  <label htmlFor={name} className={getStyles('checkbox-custom-label')}>
36
36
  {label}
package/index.js CHANGED
@@ -58,6 +58,7 @@ export { default as FooterTable } from './molecules/FooterTable'
58
58
  export { default as DynamicSelect } from './molecules/DynamicSelect'
59
59
  export { default as DatePicker } from './molecules/DynamicSelect'
60
60
  export { default as CardDefault } from './molecules/CardDefault'
61
+ export { default as Tabs } from './molecules/Tabs'
61
62
 
62
63
 
63
64
 
@@ -7,7 +7,11 @@ import withStyles from '../../hocs/withStyles'
7
7
 
8
8
  import Tab from '../../atoms/Tab/Tab'
9
9
 
10
- export const Tabs = ({ getStyles, viewTabs }) => {
10
+ export const handleClick = ({ onClickTab }) => (e, index) => {
11
+ onClickTab(e, index)
12
+ }
13
+
14
+ export const Tabs = ({ getStyles, viewTabs, options, onClickTab }) => {
11
15
 
12
16
  if (viewTabs) {
13
17
  return (
@@ -18,12 +22,12 @@ export const Tabs = ({ getStyles, viewTabs }) => {
18
22
 
19
23
  <ul>
20
24
 
21
- {options.itemTabs.map((item, index) => (
25
+ {options.map((item, index) => (
22
26
 
23
27
  <Tab
24
28
  key={index}
25
- activeTab={false}
26
- onClick={function noRefCheck() { }}
29
+ activeTab={item.active}
30
+ onClick={(e) => onClickTab(e, index) && handleClick({ onClickTab } )}
27
31
  viewTab={item.view}
28
32
  >
29
33
  {item.text}
@@ -44,10 +48,12 @@ export const Tabs = ({ getStyles, viewTabs }) => {
44
48
 
45
49
  Tabs.propTypes = {
46
50
  getStyles: PropTypes.func.isRequired,
51
+ onClickTab: PropTypes.func
47
52
  }
48
53
 
49
54
  Tabs.defaultProps = {
50
55
  getStyles: () => { },
56
+ onClickTab: () => { },
51
57
  }
52
58
 
53
- export default withStyles(styles)(Tabs)
59
+ export default withStyles(styles)(Tabs)
@@ -9,4 +9,5 @@
9
9
  justify-content: center;
10
10
  align-items: center;
11
11
  margin: 0;
12
+ padding: 0;
12
13
  }
@@ -4,26 +4,31 @@ export const options = {
4
4
  text: "Taxi",
5
5
  href: "/taxi",
6
6
  view: true,
7
+ active: false,
7
8
  },
8
9
  {
9
10
  text: "Parking",
10
11
  href: "/parking",
11
12
  view: true,
13
+ active: false,
12
14
  },
13
15
  {
14
16
  text: "Sharing",
15
17
  href: "/sharing",
16
18
  view: true,
19
+ active: false,
17
20
  },
18
21
  {
19
22
  text: "T. Publico",
20
23
  href: "/sharing",
21
24
  view: true,
25
+ active: false,
22
26
  },
23
27
  {
24
28
  text: "Hoja de Km",
25
29
  href: "/sharing",
26
30
  view: true,
31
+ active: false,
27
32
  },
28
33
  ],
29
- }
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imbric-theme",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "description": "Components library IMBRIC",
5
5
  "private": false,
6
6
  "main": "index.js",