imbric-theme 0.6.5 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- package/.storybook/main.js +1 -1
- package/.storybook/preview.js +16 -0
- package/atoms/Button/Button.module.css +10 -0
- package/atoms/Check/Check.js +6 -4
- package/atoms/Input/Input.module.css +11 -0
- package/atoms/Toggle/Toggle.js +7 -6
- package/layout/Sidebar/Sidebar.js +10 -4
- package/molecules/ColumnTable/ColumnTable.js +101 -95
- package/molecules/ColumnTable/ColumnTable.module.css +12 -0
- package/molecules/InputAutocomplete/InputAutocomplete.js +8 -5
- package/molecules/RowTable/RowTable.js +481 -479
- package/molecules/RowTable/RowTable.module.css +4 -2
- package/package.json +2 -1
- package/pages/Login/Login.js +3 -3
- package/public/static/taxisvalencia_logod.png +0 -0
- package/styles/GrupoMutua.css +391 -0
- package/styles/globals.css +3 -0
- package/styles/radiotaxiaragon.css +391 -0
- package/styles/spartan.css +391 -0
- package/styles/taxisvalencia.css +391 -0
package/.storybook/main.js
CHANGED
@@ -4,7 +4,7 @@ const reactInlineSvg = require('../webpack/reactInlineSvg')
|
|
4
4
|
|
5
5
|
module.exports = {
|
6
6
|
stories: ['../{tokens,atoms,molecules,layout,pages}/**/*.stories.@(js|mdx)'],
|
7
|
-
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
7
|
+
addons: ['@storybook/addon-links', '@storybook/addon-essentials', 'storybook-addon-theme-changer'],
|
8
8
|
staticDirs: ['../public'],
|
9
9
|
webpackFinal: loadConfigs([cssModules, reactInlineSvg]),
|
10
10
|
features: {
|
package/.storybook/preview.js
CHANGED
@@ -3,6 +3,10 @@ import React from 'react'
|
|
3
3
|
import 'minireset.css'
|
4
4
|
import '../styles/globals.css'
|
5
5
|
import '../styles/tokens.css'
|
6
|
+
import '../styles/GrupoMutua.css'
|
7
|
+
import '../styles/taxisvalencia.css'
|
8
|
+
import '../styles/radiotaxiaragon.css'
|
9
|
+
import '../styles/spartan.css'
|
6
10
|
|
7
11
|
const getStyles = ({ __sb } = {}) => ({
|
8
12
|
display: 'flex',
|
@@ -30,3 +34,15 @@ export const parameters = {
|
|
30
34
|
},
|
31
35
|
actions: { argTypesRegex: '^on[A-Z].*' },
|
32
36
|
}
|
37
|
+
|
38
|
+
export const globalTypes = {
|
39
|
+
themes: {
|
40
|
+
defaultValue: [
|
41
|
+
"Imbric",
|
42
|
+
"GrupoMutua",
|
43
|
+
"Taxisvalencia",
|
44
|
+
"Radiotaxiaragon",
|
45
|
+
"Spartan",
|
46
|
+
],
|
47
|
+
}
|
48
|
+
}
|
@@ -13,6 +13,16 @@
|
|
13
13
|
transition: filter 0.5s ease, box-shadow 0.2s ease-in;
|
14
14
|
}
|
15
15
|
|
16
|
+
[data-theme="GrupoMutua"] .button {
|
17
|
+
border-radius: var(--button-border-radius-sm);
|
18
|
+
}
|
19
|
+
|
20
|
+
[data-theme="Taxisvalencia"] .button,
|
21
|
+
[data-theme="Radiotaxiaragon"] .button,
|
22
|
+
[data-theme="Spartan"] .button {
|
23
|
+
border-radius: var(--button-border-radius-sm);
|
24
|
+
}
|
25
|
+
|
16
26
|
.button:focus {
|
17
27
|
box-shadow: 0 0 0 1px var(--color-primary), 0 0 10px 0 var(--color-primary);
|
18
28
|
outline: none;
|
package/atoms/Check/Check.js
CHANGED
@@ -6,21 +6,23 @@ import Icon from '../Icon'
|
|
6
6
|
import styles from './Check.module.css'
|
7
7
|
import withStyles from '../../hocs/withStyles'
|
8
8
|
|
9
|
-
export const Check = ({ isChecked, getStyles }) => {
|
9
|
+
export const Check = ({ isChecked, getStyles, onClickChecked }) => {
|
10
10
|
return isChecked ? (
|
11
|
-
<Icon name="checkCircle" color="muted" isClickable />
|
11
|
+
<Icon name="checkCircle" color="muted" isClickable onClick={onClickChecked} />
|
12
12
|
) : (
|
13
|
-
<span className={getStyles('check')} />
|
13
|
+
<span onClick={onClickChecked} className={getStyles('check')} />
|
14
14
|
)
|
15
15
|
}
|
16
16
|
|
17
17
|
Check.propTypes = {
|
18
18
|
getStyles: PropTypes.func.isRequired,
|
19
19
|
isChecked: PropTypes.bool,
|
20
|
+
onClickChecked: PropTypes.func,
|
20
21
|
}
|
21
22
|
|
22
23
|
Check.defaultProps = {
|
23
|
-
getStyles: () => {},
|
24
|
+
getStyles: () => { },
|
25
|
+
onClickChecked: () => { },
|
24
26
|
}
|
25
27
|
|
26
28
|
export default withStyles(styles)(Check)
|
@@ -27,6 +27,17 @@
|
|
27
27
|
background: #dedede;
|
28
28
|
}
|
29
29
|
|
30
|
+
[data-theme="GrupoMutua"] .input {
|
31
|
+
border-radius: var(--button-border-radius-sm);
|
32
|
+
}
|
33
|
+
|
34
|
+
[data-theme="Taxisvalencia"] .input,
|
35
|
+
[data-theme="Radiotaxiaragon"] .input,
|
36
|
+
[data-theme="Spartan"] .input {
|
37
|
+
border-radius: var(--button-border-radius-sm);
|
38
|
+
}
|
39
|
+
|
40
|
+
|
30
41
|
.is-inline {
|
31
42
|
max-width: max-content;
|
32
43
|
}
|
package/atoms/Toggle/Toggle.js
CHANGED
@@ -6,11 +6,11 @@ import withStyles from '../../hocs/withStyles'
|
|
6
6
|
|
7
7
|
export const Toggle = ({ getStyles, onChangeCheckbox, disabled, id, checked, name }) => {
|
8
8
|
|
9
|
-
const [isChecked, setIsChecked] = useState(false);
|
9
|
+
// const [isChecked, setIsChecked] = useState(false);
|
10
10
|
|
11
|
-
const handleOnChange = () => {
|
12
|
-
|
13
|
-
};
|
11
|
+
// const handleOnChange = () => {
|
12
|
+
// setIsChecked(!isChecked)
|
13
|
+
// };
|
14
14
|
|
15
15
|
|
16
16
|
return <div className={getStyles('toggle')}>
|
@@ -20,9 +20,10 @@ export const Toggle = ({ getStyles, onChangeCheckbox, disabled, id, checked, nam
|
|
20
20
|
id={id}
|
21
21
|
name={name}
|
22
22
|
disabled={disabled}
|
23
|
-
checked={isChecked || checked}
|
23
|
+
// checked={isChecked || checked}
|
24
|
+
checked={checked}
|
24
25
|
onChange={(e) => {
|
25
|
-
handleOnChange()
|
26
|
+
// handleOnChange()
|
26
27
|
onChangeCheckbox(e)
|
27
28
|
}}
|
28
29
|
className={getStyles('toggle-item')}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { ReactNode, useRef, useState, useEffect } from 'react'
|
2
2
|
import PropTypes from 'prop-types'
|
3
3
|
import withStyles from '../../hocs/withStyles'
|
4
|
+
import { useRouter } from 'next/router'
|
4
5
|
|
5
6
|
// import { options } from './constants'
|
6
7
|
|
@@ -11,8 +12,9 @@ import Icon from '../../atoms/Icon'
|
|
11
12
|
import Divider from '../../atoms/Divider'
|
12
13
|
import ItemMenu from '../../molecules/ItemMenu/ItemMenu'
|
13
14
|
|
14
|
-
export const Sidebar = ({ getStyles, menuCollapseView, options, isHrefLogo }) => {
|
15
|
+
export const Sidebar = ({ getStyles, menuCollapseView, options, isHrefLogo, isSrcLogoS, isSrcLogo }) => {
|
15
16
|
|
17
|
+
const router = useRouter()
|
16
18
|
|
17
19
|
return (
|
18
20
|
<>
|
@@ -30,7 +32,7 @@ export const Sidebar = ({ getStyles, menuCollapseView, options, isHrefLogo }) =>
|
|
30
32
|
|
31
33
|
<div className={getStyles('logotext')}>
|
32
34
|
{/* small and big change using menuCollapseView state */}
|
33
|
-
{menuCollapseView ? <Picture isHref={isHrefLogo} src=
|
35
|
+
{menuCollapseView ? <Picture isHref={isHrefLogo} src={router.basePath + isSrcLogoS} width={19}></Picture> : <Picture isHref={isHrefLogo} src={router.basePath + isSrcLogo} width={100}></Picture>}
|
34
36
|
</div>
|
35
37
|
{/* <div className={getStyles('closemenu')}>
|
36
38
|
|
@@ -93,7 +95,9 @@ export const Sidebar = ({ getStyles, menuCollapseView, options, isHrefLogo }) =>
|
|
93
95
|
|
94
96
|
Sidebar.propTypes = {
|
95
97
|
getStyles: PropTypes.func.isRequired,
|
96
|
-
isHrefLogo: PropTypes.any
|
98
|
+
isHrefLogo: PropTypes.any,
|
99
|
+
isSrcLogoS: PropTypes.string,
|
100
|
+
isSrcLogo: PropTypes.string
|
97
101
|
// options: PropTypes.arrayOf(
|
98
102
|
// PropTypes.shape({
|
99
103
|
// text: PropTypes.string,
|
@@ -105,7 +109,9 @@ Sidebar.propTypes = {
|
|
105
109
|
Sidebar.defaultProps = {
|
106
110
|
getStyles: () => { },
|
107
111
|
menuCollapseView: false,
|
108
|
-
isHrefLogo: ''
|
112
|
+
isHrefLogo: '',
|
113
|
+
isSrcLogoS: '',
|
114
|
+
isSrcLogo: ''
|
109
115
|
}
|
110
116
|
|
111
117
|
export default withStyles(styles)(Sidebar)
|
@@ -13,117 +13,123 @@ import { Horizontal, Vertical } from '../../layout/Spacer/components'
|
|
13
13
|
|
14
14
|
export const ColumnTable = ({ getStyles, handleSorting, columnUppercase, onChangeInput, onChangeSelect, columnsData, opSelect }) => {
|
15
15
|
|
16
|
-
const [sortable, setSortable] = useState(true)
|
17
|
-
const [accessor, setAccessor] = useState("")
|
18
|
-
|
19
|
-
const [
|
16
|
+
// const [sortable, setSortable] = useState(true)
|
17
|
+
// const [accessor, setAccessor] = useState("")
|
18
|
+
|
19
|
+
const [sortField, setSortField] = useState("")
|
20
|
+
const [order, setOrder] = useState("asc")
|
20
21
|
|
21
22
|
// const [optionsSelect, setOptionsSelect] = useState(opSelect);
|
22
23
|
|
23
24
|
|
24
25
|
const handleSortingChange = (accessor) => {
|
25
26
|
const sortOrder =
|
26
|
-
accessor === sortField && order === "asc" ? "desc" : "asc"
|
27
|
-
setSortField(accessor);
|
28
|
-
setOrder(sortOrder);
|
29
|
-
handleSorting(accessor, sortOrder);
|
30
|
-
};
|
27
|
+
accessor === sortField && order === "asc" ? "desc" : "asc"
|
31
28
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
? "angleDown"
|
37
|
-
: "default"
|
38
|
-
: "";
|
29
|
+
setSortField(accessor)
|
30
|
+
setOrder(sortOrder)
|
31
|
+
handleSorting(accessor, sortOrder)
|
32
|
+
};
|
39
33
|
|
40
34
|
|
41
35
|
return (
|
42
36
|
|
43
|
-
<div className={getStyles('tbl-header')}>
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
name="angleUp"
|
87
|
-
size="xs"
|
88
|
-
/>
|
89
|
-
: null
|
90
|
-
}
|
91
|
-
</span>
|
92
|
-
|
93
|
-
|
94
|
-
<Vertical size="xs" />
|
95
|
-
|
96
|
-
{item.viewIsFilter ? (
|
97
|
-
|
98
|
-
item.typeFilter === 'select' ?
|
99
|
-
<DynamicSelect
|
100
|
-
isInline
|
101
|
-
onChange={onChangeSelect}
|
102
|
-
optionsSelect={opSelect}
|
103
|
-
placeholder={item.placeholder}
|
104
|
-
/>
|
105
|
-
:
|
106
|
-
<Input
|
107
|
-
isInputFilter
|
108
|
-
id={item.idInput}
|
109
|
-
type={item.typeFilter}
|
110
|
-
name={item.nameInput}
|
111
|
-
onChange={onChangeInput}
|
112
|
-
placeholder={item.placeholder}
|
37
|
+
// <div className={getStyles('tbl-header')}>
|
38
|
+
// <table className={getStyles('table')} cellPadding="0" cellSpacing="0" border="0">
|
39
|
+
<thead>
|
40
|
+
<tr>
|
41
|
+
|
42
|
+
{columnsData.map(({ accessor, sortable, ...props }) => {
|
43
|
+
|
44
|
+
const cl = sortable
|
45
|
+
? sortField && sortField === accessor && order === "asc"
|
46
|
+
? "up"
|
47
|
+
: sortField && sortField === accessor && order === "desc"
|
48
|
+
? "down"
|
49
|
+
: "default"
|
50
|
+
: "";
|
51
|
+
|
52
|
+
return (
|
53
|
+
props.activeView ?
|
54
|
+
// setSortable(props.sortable)
|
55
|
+
// setAccessor()
|
56
|
+
(<th
|
57
|
+
key={props.idInput}
|
58
|
+
className={getStyles('column-table',
|
59
|
+
{ 'column-uppercase': columnUppercase },
|
60
|
+
{ 'thacction': accessor === 'iconUrl' },
|
61
|
+
{ 'thcheckbox': props.isCheckbox }
|
62
|
+
)}>
|
63
|
+
|
64
|
+
<span className={getStyles('tbl-txtTh')} onClick={sortable ? () => handleSortingChange(accessor) : null}>
|
65
|
+
<Paragraph
|
66
|
+
size="xs"
|
67
|
+
isInline
|
68
|
+
>
|
69
|
+
{props.title}
|
70
|
+
</Paragraph>
|
71
|
+
|
72
|
+
<Horizontal size="xs" />
|
73
|
+
|
74
|
+
{sortable ?
|
75
|
+
|
76
|
+
cl === "default" ?
|
77
|
+
<Icon
|
78
|
+
name="angleUpDown"
|
79
|
+
size="xs"
|
113
80
|
/>
|
114
|
-
|
115
|
-
|
81
|
+
: cl === "" ? null
|
82
|
+
|
83
|
+
: cl === "up"
|
84
|
+
? <Icon
|
85
|
+
name="angleDown"
|
86
|
+
size="xs"
|
87
|
+
/>
|
88
|
+
|
89
|
+
: <Icon
|
90
|
+
name="angleUp"
|
91
|
+
size="xs"
|
92
|
+
/>
|
116
93
|
: null
|
117
94
|
}
|
95
|
+
</span>
|
96
|
+
|
118
97
|
|
119
|
-
|
120
|
-
) : null
|
121
|
-
))}
|
98
|
+
<Vertical size="xs" />
|
122
99
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
100
|
+
{props.viewIsFilter ? (
|
101
|
+
|
102
|
+
props.typeFilter === 'select' ?
|
103
|
+
<DynamicSelect
|
104
|
+
isInline
|
105
|
+
onChange={onChangeSelect}
|
106
|
+
optionsSelect={opSelect}
|
107
|
+
placeholder={props.placeholder}
|
108
|
+
/>
|
109
|
+
:
|
110
|
+
<Input
|
111
|
+
isInputFilter
|
112
|
+
id={props.idInput}
|
113
|
+
type={props.typeFilter}
|
114
|
+
name={props.nameInput}
|
115
|
+
onChange={onChangeInput}
|
116
|
+
placeholder={props.placeholder}
|
117
|
+
/>
|
118
|
+
)
|
119
|
+
|
120
|
+
: null
|
121
|
+
}
|
122
|
+
|
123
|
+
</th>
|
124
|
+
) : null
|
125
|
+
)
|
126
|
+
|
127
|
+
})}
|
128
|
+
|
129
|
+
</tr>
|
130
|
+
</thead>
|
131
|
+
// </table>
|
132
|
+
// </div>
|
127
133
|
|
128
134
|
)
|
129
135
|
}
|
@@ -4,12 +4,24 @@
|
|
4
4
|
color: var(--color-font-base);
|
5
5
|
display: table-cell;
|
6
6
|
vertical-align: top;
|
7
|
+
/* overflow: hidden;
|
8
|
+
text-overflow: ellipsis; */
|
9
|
+
border-bottom-color: rgba(0, 0, 0, 0.12);
|
10
|
+
border-bottom-width: 1px;
|
11
|
+
border-bottom-style: solid;
|
7
12
|
}
|
8
13
|
|
9
14
|
.column-uppercase {
|
10
15
|
text-transform: uppercase;
|
11
16
|
}
|
12
17
|
|
18
|
+
.tbl-txtTh {
|
19
|
+
overflow: hidden;
|
20
|
+
text-overflow: ellipsis;
|
21
|
+
white-space: nowrap;
|
22
|
+
cursor: pointer;
|
23
|
+
}
|
24
|
+
|
13
25
|
.table {
|
14
26
|
width: 100%;
|
15
27
|
table-layout: fixed;
|
@@ -5,6 +5,7 @@ import PropTypes from 'prop-types'
|
|
5
5
|
import styles from './InputAutocomplete.module.css'
|
6
6
|
import { options } from './constants'
|
7
7
|
import withStyles from '../../hocs/withStyles'
|
8
|
+
import { useRouter } from 'next/router'
|
8
9
|
|
9
10
|
import { BarLoader, ClipLoader } from 'react-spinners'
|
10
11
|
import Input from '../../atoms/Input'
|
@@ -73,6 +74,8 @@ export const InputAutocomplete = ({
|
|
73
74
|
|
74
75
|
// }
|
75
76
|
|
77
|
+
const router = useRouter()
|
78
|
+
|
76
79
|
|
77
80
|
return <div className={getStyles('input-autocomplete')}>
|
78
81
|
|
@@ -127,11 +130,11 @@ export const InputAutocomplete = ({
|
|
127
130
|
<li id={'idLiItem' + index} key={index} className={getStyles('input-autocomplete-li')} onClick={handleOnSelect}>
|
128
131
|
{viewIconList ?
|
129
132
|
<div className={getStyles('input-autocomplete-li-icon')}>
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
133
|
+
<Picture
|
134
|
+
src={itemAddresses.iconURL ? itemAddresses.iconURL : router.basePath + "/static/google-maps.png"}
|
135
|
+
width={15}
|
136
|
+
height={15}
|
137
|
+
/>
|
135
138
|
</div>
|
136
139
|
:
|
137
140
|
null
|