imbric-theme 0.3.2 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- package/.storybook/main.js +1 -1
- package/atoms/AlertModal/AlertModal.js +77 -0
- package/atoms/AlertModal/AlertModal.module.css +3 -0
- package/atoms/AlertModal/AlertModal.stories.js +30 -0
- package/atoms/AlertModal/constants.js +4 -0
- package/atoms/AlertModal/index.js +3 -0
- package/atoms/Button/Button.js +5 -2
- package/atoms/Button/Button.module.css +6 -3
- package/atoms/Checkbox/Checkbox.js +49 -0
- package/atoms/Checkbox/Checkbox.module.css +3 -0
- package/atoms/Checkbox/Checkbox.stories.js +28 -0
- package/atoms/Checkbox/constants.js +1 -0
- package/atoms/Checkbox/index.js +3 -0
- package/atoms/Heading/Heading.js +1 -1
- package/atoms/Heading/Heading.module.css +4 -0
- package/atoms/Heading/constants.js +1 -1
- package/atoms/Icon/constants.js +30 -6
- package/atoms/Input/Input.js +21 -5
- package/atoms/Input/Input.module.css +26 -6
- package/atoms/Input/Input.stories.js +8 -2
- package/atoms/Input/__snapshots__/Input.stories.js.snap +5 -5
- package/atoms/Input/constants.js +1 -1
- package/atoms/Label/Label.js +31 -0
- package/atoms/Label/Label.module.css +38 -0
- package/atoms/Label/Label.stories.js +26 -0
- package/atoms/Label/constants.js +1 -0
- package/atoms/Label/index.js +3 -0
- package/atoms/Paragraph/Paragraph.module.css +4 -0
- package/hook/useAddColumn.js +40 -0
- package/hook/useStateDate.js +25 -0
- package/hook/useTable.js +45 -0
- package/index.js +22 -1
- package/jest.config.js +1 -1
- package/layout/DynamicTable/DynamicTable.js +172 -0
- package/layout/DynamicTable/DynamicTable.module.css +63 -0
- package/layout/DynamicTable/DynamicTable.stories.js +77 -0
- package/layout/DynamicTable/constants.js +323 -0
- package/layout/DynamicTable/index.js +3 -0
- package/layout/Navbar/Navbar.js +19 -11
- package/layout/Navbar/Navbar.module.css +4 -2
- package/layout/Navbar/Navbar.stories.js +2 -1
- package/layout/Sidebar/Sidebar.js +6 -3
- package/layout/Sidebar/Sidebar.module.css +1 -10
- package/layout/Sidebar/Sidebar.stories.js +1 -1
- package/layout/Sidebar/constants.js +228 -205
- package/molecules/CheckList/CheckList.js +135 -0
- package/molecules/CheckList/CheckList.module.css +94 -0
- package/molecules/CheckList/CheckList.stories.js +25 -0
- package/molecules/CheckList/constants.js +23 -0
- package/molecules/CheckList/index.js +3 -0
- package/molecules/ColumnTable/ColumnTable.js +124 -0
- package/molecules/ColumnTable/ColumnTable.module.css +22 -0
- package/molecules/ColumnTable/ColumnTable.stories.js +26 -0
- package/molecules/ColumnTable/constants.js +111 -0
- package/molecules/ColumnTable/index.js +3 -0
- package/molecules/DatePicker/DatePicker.js +236 -0
- package/molecules/DatePicker/DatePicker.module.css +38 -0
- package/molecules/DatePicker/DatePicker.stories.js +23 -0
- package/molecules/DatePicker/constants.js +3 -0
- package/molecules/DatePicker/index.js +3 -0
- package/molecules/Dropdown/Dropdown.js +25 -22
- package/molecules/Dropdown/Dropdown.module.css +21 -3
- package/molecules/DynamicSelect/DynamicSelect.js +109 -0
- package/molecules/DynamicSelect/DynamicSelect.module.css +10 -0
- package/molecules/DynamicSelect/DynamicSelect.stories.js +32 -0
- package/molecules/DynamicSelect/constants.js +7 -0
- package/molecules/DynamicSelect/index.js +3 -0
- package/molecules/Error/Error.js +2 -2
- package/molecules/Error/Error.module.css +3 -2
- package/molecules/FooterTable/FooterTable.js +47 -0
- package/molecules/FooterTable/FooterTable.module.css +37 -0
- package/molecules/FooterTable/FooterTable.stories.js +23 -0
- package/molecules/FooterTable/constants.js +1 -0
- package/molecules/FooterTable/index.js +3 -0
- package/molecules/ItemMenu/ItemMenu.js +35 -24
- package/molecules/ItemMenu/ItemMenu.module.css +13 -4
- package/molecules/ItemMenu/ItemMenu.stories.js +2 -0
- package/molecules/ItemMenu/constants.js +3 -0
- package/molecules/RowTable/RowTable.js +68 -0
- package/molecules/RowTable/RowTable.module.css +22 -0
- package/molecules/RowTable/RowTable.stories.js +26 -0
- package/molecules/RowTable/constants.js +305 -0
- package/molecules/RowTable/index.js +3 -0
- package/package.json +11 -2
- package/pages/Login/Login.js +102 -0
- package/pages/Login/Login.module.css +5 -0
- package/pages/Login/Login.stories.js +23 -0
- package/pages/Login/constants.js +1 -0
- package/pages/Login/index.js +3 -0
- package/pages/Login/validation/loginSchema.js +5 -0
- package/public/static/logologin.svg +16 -0
- package/scripts/create-component.js +2 -1
- package/storybook-static/0.263f852f.iframe.bundle.js +1 -0
- package/storybook-static/0.91dbd3f3aa2099d25061.manager.bundle.js +1 -0
- package/storybook-static/1.17e9ac7e.iframe.bundle.js +3 -0
- package/storybook-static/1.17e9ac7e.iframe.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/1.17e9ac7e.iframe.bundle.js.map +1 -0
- package/storybook-static/2.cc4000c2.iframe.bundle.js +1 -0
- package/storybook-static/3.e9f95d01.iframe.bundle.js +1 -0
- package/storybook-static/4.be0a752c9f5176d6eec1.manager.bundle.js +2 -0
- package/storybook-static/4.be0a752c9f5176d6eec1.manager.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/5.8efdde123acaf8fbb100.manager.bundle.js +1 -0
- package/storybook-static/6.2f82294ae0b087aecb24.manager.bundle.js +2 -0
- package/storybook-static/6.2f82294ae0b087aecb24.manager.bundle.js.LICENSE.txt +12 -0
- package/storybook-static/7.97068037.iframe.bundle.js +1 -0
- package/storybook-static/7.fa9452d2609e8a00f314.manager.bundle.js +1 -0
- package/storybook-static/8.66f5ef1c66fc4628f127.manager.bundle.js +1 -0
- package/storybook-static/8.b545d602.iframe.bundle.js +3 -0
- package/storybook-static/8.b545d602.iframe.bundle.js.LICENSE.txt +12 -0
- package/storybook-static/8.b545d602.iframe.bundle.js.map +1 -0
- package/storybook-static/9.269ed917.iframe.bundle.js +1 -0
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/iframe.html +348 -0
- package/storybook-static/index.html +59 -0
- package/storybook-static/main.157061c9.iframe.bundle.js +1 -0
- package/storybook-static/main.5a07347846ccf2d7e5dc.manager.bundle.js +1 -0
- package/storybook-static/runtime~main.a14e6e62.iframe.bundle.js +1 -0
- package/storybook-static/runtime~main.f78c3fae275fc212c109.manager.bundle.js +1 -0
- package/storybook-static/static/logo.svg +19 -0
- package/storybook-static/static/logologin.svg +16 -0
- package/storybook-static/static/logotipo.svg +50 -0
- package/storybook-static/static/logotipoS.svg +26 -0
- package/storybook-static/vendors~main.720e76f4.iframe.bundle.js +3 -0
- package/storybook-static/vendors~main.720e76f4.iframe.bundle.js.LICENSE.txt +110 -0
- package/storybook-static/vendors~main.720e76f4.iframe.bundle.js.map +1 -0
- package/storybook-static/vendors~main.fcd0b2a3431ddf75f5f7.manager.bundle.js +2 -0
- package/storybook-static/vendors~main.fcd0b2a3431ddf75f5f7.manager.bundle.js.LICENSE.txt +101 -0
- package/styles/globals.css +592 -0
- package/styles/tokens.css +2 -1
- package/tokens/index.js +2 -1
@@ -16,14 +16,32 @@
|
|
16
16
|
.dropdown-select {
|
17
17
|
width: 100%;
|
18
18
|
height: var(--input-height);
|
19
|
-
padding:
|
20
|
-
border: var(--border-width-thin) solid var(--color-
|
19
|
+
padding: 8px 30px 8px 20px;
|
20
|
+
border: var(--border-width-thin) solid var(--color-brand-white-lilac);
|
21
21
|
background: var(--input-background);
|
22
|
-
border-radius: var(--input-border-radius);
|
22
|
+
/* border-radius: var(--input-border-radius); */
|
23
23
|
color: var(--color-font-base);
|
24
|
+
font-family: var(--font-family-sans);
|
25
|
+
font-size: var(--input-font-base);
|
26
|
+
font-weight: var(--font-weight-medium);
|
27
|
+
line-height: var(--line-height-relaxed);
|
24
28
|
transition: box-shadow 0.2s ease;
|
29
|
+
-moz-appearance: none; /* Firefox */
|
30
|
+
-webkit-appearance: none; /* Safari and Chrome */
|
31
|
+
appearance: none;
|
25
32
|
}
|
26
33
|
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
/* padding: 12px 17px; */
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
27
45
|
.dropdown-select:focus {
|
28
46
|
box-shadow: 0 0 0 1px var(--color-primary), 0 0 10px 0 var(--color-primary);
|
29
47
|
outline: none;
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Select from 'react-select'
|
3
|
+
import PropTypes from 'prop-types'
|
4
|
+
import styles from './DynamicSelect.module.css'
|
5
|
+
import withStyles from '../../hocs/withStyles'
|
6
|
+
|
7
|
+
|
8
|
+
export const DynamicSelect = ({ getStyles, optionsSelect, defaultValue, placeholder, isMulti, isClearable, isDisabled, isLoading, isRtl, isSearchable, isInline, onChange }) => {
|
9
|
+
|
10
|
+
|
11
|
+
const customStyles = {
|
12
|
+
|
13
|
+
option: (base, state) => ({
|
14
|
+
...base,
|
15
|
+
cursor: 'pointer',
|
16
|
+
height: '100%',
|
17
|
+
backgroundColor: state.isSelected ? 'var(--color-primary)' : 'transparent',
|
18
|
+
"&:hover": {
|
19
|
+
backgroundColor: "var(--color-primary-highlight)",
|
20
|
+
color: 'var(--color-primary)',
|
21
|
+
},
|
22
|
+
// "&:active": {
|
23
|
+
// backgroundColor: "var(--color-primary)"
|
24
|
+
// }
|
25
|
+
}),
|
26
|
+
control: (base, state) => ({
|
27
|
+
...base,
|
28
|
+
cursor: 'pointer',
|
29
|
+
width: '100%',
|
30
|
+
borderRadius: 0,
|
31
|
+
border: 'var(--border-width-thin) solid var(--color-brand-white-lilac)',
|
32
|
+
// border: state.isFocused ? "var(--border-width-thin) solid var(--color-brand-white-lilac)" : "var(--border-width-thin) solid var(--color-brand-white-lilac)",
|
33
|
+
boxShadow: state.isFocused ? "0 0 0 1px var(--color-primary), 0 0 10px 0 var(--color-primary)" : "none",
|
34
|
+
"&:hover": {
|
35
|
+
borderColor: "var(--color-primary)"
|
36
|
+
}
|
37
|
+
}),
|
38
|
+
input: (base) => ({
|
39
|
+
...base,
|
40
|
+
cursor: 'pointer',
|
41
|
+
margin: '2px',
|
42
|
+
paddingBottom: '2px',
|
43
|
+
paddingTop: '2px',
|
44
|
+
}),
|
45
|
+
|
46
|
+
}
|
47
|
+
|
48
|
+
// const handleChange = (value) => {
|
49
|
+
// console.group('Value Changed');
|
50
|
+
// console.log(value);
|
51
|
+
// // console.log(`action: ${actionMeta.action}`);
|
52
|
+
// console.groupEnd();
|
53
|
+
// };
|
54
|
+
|
55
|
+
return (
|
56
|
+
|
57
|
+
<div className={getStyles('dynamic-select', {
|
58
|
+
'is-inline': isInline,
|
59
|
+
})}>
|
60
|
+
<Select
|
61
|
+
name="basic"
|
62
|
+
// className="basic-single"
|
63
|
+
// classNamePrefix="select"
|
64
|
+
placeholder={placeholder}
|
65
|
+
styles={customStyles}
|
66
|
+
options={optionsSelect}
|
67
|
+
defaultValue={defaultValue}
|
68
|
+
isMulti={isMulti}
|
69
|
+
isClearable={isClearable}
|
70
|
+
isDisabled={isDisabled}
|
71
|
+
isLoading={isLoading}
|
72
|
+
isRtl={isRtl}
|
73
|
+
isSearchable={isSearchable}
|
74
|
+
onChange={onChange}
|
75
|
+
/>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
)
|
79
|
+
}
|
80
|
+
|
81
|
+
DynamicSelect.propTypes = {
|
82
|
+
getStyles: PropTypes.func.isRequired,
|
83
|
+
defaultValue: PropTypes.string,
|
84
|
+
placeholder: PropTypes.string,
|
85
|
+
isMulti: PropTypes.bool,
|
86
|
+
isClearable: PropTypes.bool,
|
87
|
+
isDisabled: PropTypes.bool,
|
88
|
+
isLoading: PropTypes.bool,
|
89
|
+
isRtl: PropTypes.bool,
|
90
|
+
isSearchable: PropTypes.bool,
|
91
|
+
isInline: PropTypes.bool,
|
92
|
+
onChange: PropTypes.func
|
93
|
+
}
|
94
|
+
|
95
|
+
DynamicSelect.defaultProps = {
|
96
|
+
getStyles: () => { },
|
97
|
+
defaultValue: '',
|
98
|
+
placeholder: 'seleccionar',
|
99
|
+
isMulti: false,
|
100
|
+
isClearable: true,
|
101
|
+
isDisabled: false,
|
102
|
+
isLoading: false,
|
103
|
+
isRtl: false,
|
104
|
+
isSearchable: false,
|
105
|
+
isInline: false,
|
106
|
+
onChange: () => { },
|
107
|
+
}
|
108
|
+
|
109
|
+
export default withStyles(styles)(DynamicSelect)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { DynamicSelect, styles, options } from '.'
|
2
|
+
|
3
|
+
import {
|
4
|
+
getTemplate,
|
5
|
+
getListTemplate,
|
6
|
+
getOptionsArgTypes,
|
7
|
+
} from '../../helpers/storybook'
|
8
|
+
|
9
|
+
const Template = getTemplate(DynamicSelect, styles)
|
10
|
+
const ListTemplate = getListTemplate(DynamicSelect, styles)
|
11
|
+
|
12
|
+
export default {
|
13
|
+
title: 'Molecules/DynamicSelect',
|
14
|
+
component: DynamicSelect,
|
15
|
+
args: {
|
16
|
+
optionsSelect: options.optionsSelect,
|
17
|
+
defaultValue: '',
|
18
|
+
placeholder: 'seleccionar',
|
19
|
+
isMulti: false,
|
20
|
+
isClearable: true,
|
21
|
+
isDisabled: false,
|
22
|
+
isLoading: false,
|
23
|
+
isRtl: false,
|
24
|
+
isSearchable: false,
|
25
|
+
isInline: false,
|
26
|
+
},
|
27
|
+
argTypes: {
|
28
|
+
// types: getOptionsArgTypes(options.types),
|
29
|
+
},
|
30
|
+
}
|
31
|
+
|
32
|
+
export const Default = Template.bind({})
|
package/molecules/Error/Error.js
CHANGED
@@ -12,11 +12,11 @@ import Icon from '../../atoms/Icon'
|
|
12
12
|
export const Error = ({ title, children, getStyles }) => {
|
13
13
|
return (
|
14
14
|
<div className={getStyles('error')}>
|
15
|
-
<Icon className="icon-warning" name="warning" size="
|
15
|
+
<Icon className="icon-warning" name="warning" size="lg" />
|
16
16
|
<Spacer.Horizontal size="sm" />
|
17
17
|
<div>
|
18
18
|
{title && <Heading>{title}</Heading>}
|
19
|
-
<Paragraph>{children}</Paragraph>
|
19
|
+
<Paragraph size="sm">{children}</Paragraph>
|
20
20
|
</div>
|
21
21
|
</div>
|
22
22
|
)
|
@@ -1,9 +1,10 @@
|
|
1
1
|
.error {
|
2
2
|
display: flex;
|
3
3
|
padding: 10px 20px;
|
4
|
-
border-top:
|
5
|
-
background: var(--color-red-
|
4
|
+
border-top: 2px solid var(--color-red-500);
|
5
|
+
background: var(--color-red-100);
|
6
6
|
color: var(--color-red-800);
|
7
|
+
border-radius: var(--border-radius-sm);
|
7
8
|
}
|
8
9
|
|
9
10
|
.error :global(.icon-warning) {
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import React, { useEffect } from "react";
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import styles from './FooterTable.module.css'
|
5
|
+
import { options } from './constants'
|
6
|
+
import withStyles from '../../hocs/withStyles'
|
7
|
+
|
8
|
+
export const FooterTable = ({ getStyles, range, setPage, page, slice }) => {
|
9
|
+
useEffect(() => {
|
10
|
+
if (slice.length < 1 && page !== 1) {
|
11
|
+
setPage(page - 1);
|
12
|
+
}
|
13
|
+
}, [slice, page, setPage]);
|
14
|
+
|
15
|
+
return (
|
16
|
+
<div className={getStyles('footer-table')}>
|
17
|
+
|
18
|
+
<div className={styles.tableFooter}>
|
19
|
+
{range.map((el, index) => (
|
20
|
+
<button
|
21
|
+
key={index}
|
22
|
+
className={`${styles.button} ${page === el ? styles.activeButton : styles.inactiveButton
|
23
|
+
}`}
|
24
|
+
onClick={() => setPage(el)}
|
25
|
+
>
|
26
|
+
{el}
|
27
|
+
</button>
|
28
|
+
))}
|
29
|
+
</div>
|
30
|
+
|
31
|
+
</div>
|
32
|
+
|
33
|
+
|
34
|
+
)
|
35
|
+
}
|
36
|
+
|
37
|
+
FooterTable.propTypes = {
|
38
|
+
// children: PropTypes.node.isRequired,
|
39
|
+
getStyles: PropTypes.func.isRequired,
|
40
|
+
// type: PropTypes.oneOf(options.types),
|
41
|
+
}
|
42
|
+
|
43
|
+
FooterTable.defaultProps = {
|
44
|
+
getStyles: () => { },
|
45
|
+
}
|
46
|
+
|
47
|
+
export default withStyles(styles)(FooterTable)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
.footer-table {
|
2
|
+
display: flex;
|
3
|
+
}
|
4
|
+
|
5
|
+
.tableFooter {
|
6
|
+
background-color: #f1f1f1;
|
7
|
+
padding: 8px 0px;
|
8
|
+
width: 100%;
|
9
|
+
font-weight: 500;
|
10
|
+
text-align: left;
|
11
|
+
font-size: 16px;
|
12
|
+
color: #2c3e50;
|
13
|
+
border-bottom-left-radius: 15px;
|
14
|
+
border-bottom-right-radius: 15px;
|
15
|
+
display: flex;
|
16
|
+
align-items: center;
|
17
|
+
justify-content: center;
|
18
|
+
}
|
19
|
+
|
20
|
+
.button {
|
21
|
+
border: none;
|
22
|
+
padding: 7px 14px;
|
23
|
+
border-radius: 10px;
|
24
|
+
cursor: pointer;
|
25
|
+
margin-right: 4px;
|
26
|
+
margin-left: 4px;
|
27
|
+
}
|
28
|
+
|
29
|
+
.activeButton {
|
30
|
+
color: white;
|
31
|
+
background: #185adb;
|
32
|
+
}
|
33
|
+
|
34
|
+
.inactiveButton {
|
35
|
+
color: #2c3e50;
|
36
|
+
background: #f9f9f9;
|
37
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { FooterTable, styles, options } from '.'
|
2
|
+
|
3
|
+
import {
|
4
|
+
getTemplate,
|
5
|
+
getListTemplate,
|
6
|
+
getOptionsArgTypes,
|
7
|
+
} from '../../helpers/storybook'
|
8
|
+
|
9
|
+
const Template = getTemplate(FooterTable, styles)
|
10
|
+
const ListTemplate = getListTemplate(FooterTable, styles)
|
11
|
+
|
12
|
+
export default {
|
13
|
+
title: 'Molecules/FooterTable',
|
14
|
+
component: FooterTable,
|
15
|
+
args: {},
|
16
|
+
argTypes: {
|
17
|
+
// types: getOptionsArgTypes(options.types),
|
18
|
+
},
|
19
|
+
}
|
20
|
+
|
21
|
+
export const Default = Template.bind({})
|
22
|
+
// export const List = ListTemplate.bind({})
|
23
|
+
// List.args = { items: options.types.map((type) => ({ type })) }
|
@@ -0,0 +1 @@
|
|
1
|
+
export const options = { types: [] }
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
2
|
import PropTypes from 'prop-types'
|
3
|
+
import Link from 'next/link'
|
3
4
|
|
4
5
|
import styles from './ItemMenu.module.css'
|
5
6
|
import { options } from './constants'
|
@@ -7,7 +8,7 @@ import withStyles from '../../hocs/withStyles'
|
|
7
8
|
|
8
9
|
import Icon from '../../atoms/Icon'
|
9
10
|
|
10
|
-
export const ItemMenu = ({ children, getStyles, size, icon, color, background, subMenu, itemSubmenu }) => {
|
11
|
+
export const ItemMenu = ({ children, getStyles, size, icon, color, background, subMenu, itemSubmenu, itemHref, itemActive }) => {
|
11
12
|
|
12
13
|
//create initial menuCollapse state using useState hook
|
13
14
|
const [subMenuCollapse, setSubMenuCollapse] = useState(false)
|
@@ -22,45 +23,50 @@ export const ItemMenu = ({ children, getStyles, size, icon, color, background, s
|
|
22
23
|
if (!subMenu) {
|
23
24
|
return (
|
24
25
|
<>
|
25
|
-
<
|
26
|
+
<Link href={itemHref} passHref>
|
27
|
+
<li className={getStyles('pro-menu-item', { 'active': itemActive })}>
|
26
28
|
|
27
|
-
|
29
|
+
<div className={getStyles('pro-inner-item')}>
|
28
30
|
|
29
|
-
|
31
|
+
<span className={getStyles('pro-icon-wrapper')}>
|
30
32
|
|
31
|
-
|
32
|
-
<Icon
|
33
|
-
size={size}
|
34
|
-
name={icon}
|
35
|
-
color={color}
|
36
|
-
background={background}
|
37
|
-
onClick={function noRefCheck() { }}
|
38
|
-
/>
|
39
|
-
</span>
|
33
|
+
<span className={getStyles('pro-icon')}>
|
40
34
|
|
41
|
-
|
35
|
+
<Icon
|
36
|
+
size={size}
|
37
|
+
name={icon}
|
38
|
+
color={ itemActive ? 'primary' : color}
|
39
|
+
background={background}
|
40
|
+
onClick={function noRefCheck() { }}
|
41
|
+
/>
|
42
42
|
|
43
|
-
|
43
|
+
</span>
|
44
44
|
|
45
|
-
|
45
|
+
</span>
|
46
46
|
|
47
|
-
|
47
|
+
<span className={getStyles('pro-item-content', { 'color': color })}>{children}</span>
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
</li>
|
52
|
+
</Link>
|
48
53
|
</>
|
49
54
|
)
|
50
55
|
} else {
|
51
56
|
return (
|
52
57
|
<>
|
53
|
-
<li className={getStyles('pro-menu-item', 'pro-sub-menu', { 'open': subMenuCollapse })} title="Home" href="/">
|
58
|
+
<li className={getStyles('pro-menu-item', 'pro-sub-menu', { 'open': subMenuCollapse }, { 'activesubtxt': itemActive })} title="Home" href="/">
|
54
59
|
|
55
60
|
<div className={getStyles('pro-inner-item')} onClick={subMenuIconClick}>
|
56
61
|
|
57
62
|
<span className={getStyles('pro-icon-wrapper')}>
|
58
63
|
|
59
64
|
<span className={getStyles('pro-icon')}>
|
65
|
+
|
60
66
|
<Icon
|
61
67
|
size={size}
|
62
68
|
name={icon}
|
63
|
-
color={color}
|
69
|
+
color={ itemActive ? 'primary' : color}
|
64
70
|
background={background}
|
65
71
|
onClick={function noRefCheck() { }}
|
66
72
|
/>
|
@@ -68,7 +74,7 @@ export const ItemMenu = ({ children, getStyles, size, icon, color, background, s
|
|
68
74
|
|
69
75
|
</span>
|
70
76
|
|
71
|
-
<span className={getStyles('pro-item-content', { 'color': color })}>{children}</span>
|
77
|
+
<span className={getStyles('pro-item-content', 'title', { 'color': color })}>{children}</span>
|
72
78
|
|
73
79
|
<span className={getStyles('pro-arrow-wrapper')}>
|
74
80
|
<span className={getStyles('pro-arrow')}></span>
|
@@ -81,10 +87,12 @@ export const ItemMenu = ({ children, getStyles, size, icon, color, background, s
|
|
81
87
|
<ul>
|
82
88
|
|
83
89
|
{itemSubmenu.map((item, index) => (
|
84
|
-
<
|
85
|
-
<
|
86
|
-
<
|
87
|
-
|
90
|
+
<Link key={index} href={item.href} passHref>
|
91
|
+
<li className={getStyles('pro-menu-item', { 'activesub': item.active })}>
|
92
|
+
<div className={getStyles('pro-inner-item')} role="button">
|
93
|
+
<span className={getStyles('pro-item-content')}>{item.text}</span></div>
|
94
|
+
</li>
|
95
|
+
</Link>
|
88
96
|
))}
|
89
97
|
</ul>
|
90
98
|
</div>
|
@@ -102,6 +110,7 @@ ItemMenu.propTypes = {
|
|
102
110
|
children: PropTypes.node.isRequired,
|
103
111
|
getStyles: PropTypes.func.isRequired,
|
104
112
|
subMenu: PropTypes.bool.isRequired,
|
113
|
+
itemActive: PropTypes.bool,
|
105
114
|
icon: PropTypes.oneOf(options.icons),
|
106
115
|
size: PropTypes.oneOf(options.sizes),
|
107
116
|
color: PropTypes.oneOf(options.colors),
|
@@ -110,10 +119,12 @@ ItemMenu.propTypes = {
|
|
110
119
|
|
111
120
|
ItemMenu.defaultProps = {
|
112
121
|
subMenu: false,
|
122
|
+
itemActive: false,
|
113
123
|
icon: 'home',
|
114
124
|
size: 'lg',
|
115
125
|
color: 'highlight',
|
116
126
|
background: 'transparent',
|
127
|
+
itemHref: '/',
|
117
128
|
getStyles: () => { },
|
118
129
|
}
|
119
130
|
|
@@ -89,14 +89,23 @@
|
|
89
89
|
color: var(--color-primary);
|
90
90
|
}
|
91
91
|
|
92
|
-
|
93
92
|
/* ////////////////////// */
|
94
93
|
|
94
|
+
.pro-menu-item.active .pro-item-content {
|
95
|
+
color: var(--color-primary);
|
96
|
+
}
|
95
97
|
|
96
|
-
.pro-menu-item.
|
97
|
-
color:
|
98
|
+
.pro-sub-menu .pro-menu-item.activesub .pro-item-content {
|
99
|
+
color: var(--color-primary);
|
98
100
|
}
|
99
101
|
|
102
|
+
.pro-menu-item.pro-sub-menu.activesubtxt .pro-inner-item .pro-item-content.title {
|
103
|
+
color: var(--color-primary);
|
104
|
+
/* font-size: 32px; */
|
105
|
+
}
|
106
|
+
|
107
|
+
/* ////////////////////// */
|
108
|
+
|
100
109
|
.pro-menu-item .suffix-wrapper {
|
101
110
|
opacity: 1;
|
102
111
|
transition: opacity 0.2s;
|
@@ -190,7 +199,7 @@
|
|
190
199
|
}
|
191
200
|
|
192
201
|
.pro-menu-item.pro-sub-menu .pro-inner-list-item .pro-inner-item {
|
193
|
-
padding:
|
202
|
+
padding: 10px 30px 10px 15px;
|
194
203
|
margin: 0;
|
195
204
|
}
|
196
205
|
|
@@ -18,16 +18,19 @@ export const options = {
|
|
18
18
|
text: "Taxi",
|
19
19
|
href: "/taxi",
|
20
20
|
view: true,
|
21
|
+
active: false,
|
21
22
|
},
|
22
23
|
{
|
23
24
|
text: "Parking",
|
24
25
|
href: "/parking",
|
25
26
|
view: true,
|
27
|
+
active: false,
|
26
28
|
},
|
27
29
|
{
|
28
30
|
text: "Sharing",
|
29
31
|
href: "/sharing",
|
30
32
|
view: true,
|
33
|
+
active: false,
|
31
34
|
},
|
32
35
|
],
|
33
36
|
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import styles from './RowTable.module.css'
|
5
|
+
import { options } from './constants'
|
6
|
+
import withStyles from '../../hocs/withStyles'
|
7
|
+
|
8
|
+
import Moment from 'react-moment'
|
9
|
+
|
10
|
+
export const RowTable = ({ getStyles, slice, columnsData }) => {
|
11
|
+
return (
|
12
|
+
<div className={getStyles('tbl-content')}>
|
13
|
+
<table className={getStyles('table')} cellPadding="0" cellSpacing="0" border="0">
|
14
|
+
<tbody>
|
15
|
+
{slice.map((item, index) => (
|
16
|
+
|
17
|
+
<tr key={index}>
|
18
|
+
{columnsData.map((itemTd) => (
|
19
|
+
itemTd.activeView ?
|
20
|
+
|
21
|
+
(
|
22
|
+
itemTd.subAccessor !== '' ?
|
23
|
+
|
24
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor][itemTd.subAccessor]}</td> :
|
25
|
+
|
26
|
+
itemTd.typeFilter === 'date' ?
|
27
|
+
|
28
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>
|
29
|
+
<Moment format="DD/MM/YYYY hh:mm:ss">
|
30
|
+
{item[itemTd.accessor]}
|
31
|
+
</Moment>
|
32
|
+
</td>
|
33
|
+
|
34
|
+
: itemTd.typeFilter === 'number' ?
|
35
|
+
|
36
|
+
itemTd.subTypeFilter ?
|
37
|
+
|
38
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor].toFixed(2).toString().replace(/\./g, ',')} €</td>
|
39
|
+
:
|
40
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor]}</td>
|
41
|
+
|
42
|
+
: itemTd.subTypeFilter ?
|
43
|
+
|
44
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor].toString().replace(/\./g, ',').slice(0, 5)} €</td>
|
45
|
+
:
|
46
|
+
<td className={getStyles('td')} key={[itemTd.accessor]}>{item[itemTd.accessor]}</td>
|
47
|
+
|
48
|
+
) : null
|
49
|
+
))}
|
50
|
+
</tr>
|
51
|
+
|
52
|
+
))}
|
53
|
+
</tbody>
|
54
|
+
</table>
|
55
|
+
</div>
|
56
|
+
)
|
57
|
+
}
|
58
|
+
|
59
|
+
RowTable.propTypes = {
|
60
|
+
getStyles: PropTypes.func.isRequired,
|
61
|
+
type: PropTypes.oneOf(options.types),
|
62
|
+
}
|
63
|
+
|
64
|
+
RowTable.defaultProps = {
|
65
|
+
getStyles: () => { },
|
66
|
+
}
|
67
|
+
|
68
|
+
export default withStyles(styles)(RowTable)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
.table {
|
2
|
+
width: 100%;
|
3
|
+
table-layout: fixed;
|
4
|
+
|
5
|
+
}
|
6
|
+
|
7
|
+
.tbl-content {
|
8
|
+
height: max-content;
|
9
|
+
overflow-x: auto;
|
10
|
+
margin-top: 0px;
|
11
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
12
|
+
}
|
13
|
+
|
14
|
+
.td {
|
15
|
+
padding: 15px;
|
16
|
+
text-align: left;
|
17
|
+
vertical-align: middle;
|
18
|
+
font-weight: 300;
|
19
|
+
font-size: 12px;
|
20
|
+
color: var(--color-font-base);
|
21
|
+
border-bottom: solid 1px rgba(0, 0, 0, 0.1);
|
22
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { RowTable, styles, options } from '.'
|
2
|
+
|
3
|
+
import {
|
4
|
+
getTemplate,
|
5
|
+
getListTemplate,
|
6
|
+
getOptionsArgTypes,
|
7
|
+
} from '../../helpers/storybook'
|
8
|
+
|
9
|
+
const Template = getTemplate(RowTable, styles)
|
10
|
+
const ListTemplate = getListTemplate(RowTable, styles)
|
11
|
+
|
12
|
+
export default {
|
13
|
+
title: 'Molecules/RowTable',
|
14
|
+
component: RowTable,
|
15
|
+
args: {
|
16
|
+
slice: options.bookings,
|
17
|
+
columnsData: options.columns,
|
18
|
+
},
|
19
|
+
argTypes: {
|
20
|
+
// types: getOptionsArgTypes(options.types),
|
21
|
+
},
|
22
|
+
}
|
23
|
+
|
24
|
+
export const Default = Template.bind({})
|
25
|
+
// export const List = ListTemplate.bind({})
|
26
|
+
// List.args = { items: options.types.map((type) => ({ type })) }
|