imbric-theme 0.3.3 → 0.3.6
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 +66 -0
- package/atoms/Checkbox/Checkbox.module.css +54 -0
- package/atoms/Checkbox/Checkbox.stories.js +30 -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 +22 -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/LinkItem/LinkItem.js +36 -0
- package/atoms/{Link/Link.module.css → LinkItem/LinkItem.module.css} +6 -1
- package/atoms/{Link/Link.stories.js → LinkItem/LinkItem.stories.js} +5 -5
- package/atoms/{Link → LinkItem}/__snapshots__/Link.stories.js.snap +0 -0
- package/atoms/{Link → LinkItem}/constants.js +0 -0
- package/atoms/LinkItem/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 +23 -2
- 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.module.css +1 -0
- 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 +126 -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 +118 -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/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 +8 -1
- 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
- package/atoms/Link/Link.js +0 -33
- package/atoms/Link/index.js +0 -3
package/.storybook/main.js
CHANGED
@@ -3,7 +3,7 @@ const cssModules = require('../webpack/cssModules')
|
|
3
3
|
const reactInlineSvg = require('../webpack/reactInlineSvg')
|
4
4
|
|
5
5
|
module.exports = {
|
6
|
-
stories: ['../{tokens,atoms,molecules,layout}/**/*.stories.@(js|mdx)'],
|
6
|
+
stories: ['../{tokens,atoms,molecules,layout,pages}/**/*.stories.@(js|mdx)'],
|
7
7
|
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
8
8
|
staticDirs: ['../public'],
|
9
9
|
webpackFinal: loadConfigs([cssModules, reactInlineSvg]),
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import styles from './AlertModal.module.css'
|
5
|
+
import { options } from './constants'
|
6
|
+
import withStyles from '../../hocs/withStyles'
|
7
|
+
import withReactContent from 'sweetalert2-react-content'
|
8
|
+
import Swal from 'sweetalert2'
|
9
|
+
|
10
|
+
export const handleClickConfirmed = ( resultIsConfirmed ) => {
|
11
|
+
resultIsConfirmed
|
12
|
+
}
|
13
|
+
|
14
|
+
|
15
|
+
export const AlertModal = ({ children, getStyles, titleAlert, subTitleAlert, iconAlert, txtBtnAlert, resultIsConfirmed, resultIsDenied }) => {
|
16
|
+
|
17
|
+
const MySwal = withReactContent(Swal)
|
18
|
+
|
19
|
+
// MySwal.fire({
|
20
|
+
// title: <p>Hello World</p>,
|
21
|
+
// didOpen: () => {
|
22
|
+
// // `MySwal` is a subclass of `Swal` with all the same instance & static methods
|
23
|
+
// MySwal.showLoading()
|
24
|
+
// },
|
25
|
+
// }).then(() => {
|
26
|
+
// return MySwal.fire(<p>Shorthand works too</p>)
|
27
|
+
// })
|
28
|
+
|
29
|
+
// MySwal.fire(
|
30
|
+
// 'Good job!',
|
31
|
+
// 'You clicked the button!',
|
32
|
+
// 'success'
|
33
|
+
// )
|
34
|
+
|
35
|
+
MySwal.fire({
|
36
|
+
title: titleAlert,
|
37
|
+
icon: iconAlert,
|
38
|
+
html: subTitleAlert,
|
39
|
+
confirmButtonText: txtBtnAlert,
|
40
|
+
}).then((result) => {
|
41
|
+
/* Read more about isConfirmed, isDenied below */
|
42
|
+
if (result.isConfirmed) {
|
43
|
+
|
44
|
+
handleClickConfirmed(resultIsConfirmed)
|
45
|
+
|
46
|
+
} else if (result.isDenied) {
|
47
|
+
resultIsDenied
|
48
|
+
}
|
49
|
+
})
|
50
|
+
|
51
|
+
|
52
|
+
return <div className={getStyles('alert-modal')}>{children}</div>
|
53
|
+
}
|
54
|
+
|
55
|
+
AlertModal.propTypes = {
|
56
|
+
children: PropTypes.node,
|
57
|
+
getStyles: PropTypes.func.isRequired,
|
58
|
+
titleAlert: PropTypes.string.isRequired,
|
59
|
+
subTitleAlert: PropTypes.string.isRequired,
|
60
|
+
txtBtnAlert: PropTypes.string.isRequired,
|
61
|
+
resultIsConfirmed: PropTypes.any,
|
62
|
+
resultIsDenied: PropTypes.any,
|
63
|
+
iconAlert: PropTypes.oneOf(options.icon),
|
64
|
+
}
|
65
|
+
|
66
|
+
AlertModal.defaultProps = {
|
67
|
+
getStyles: () => {},
|
68
|
+
titleAlert: 'Felicidades!',
|
69
|
+
subTitleAlert: 'Ejemplo de subtitulo',
|
70
|
+
txtBtnAlert: 'Aceptar',
|
71
|
+
iconAlert: 'success',
|
72
|
+
// resultIsConfirmed: () => { setModalAlert(false)},
|
73
|
+
// resultIsConfirmed: (setModalAlert(false)),
|
74
|
+
// resultIsDenied: '',
|
75
|
+
}
|
76
|
+
|
77
|
+
export default withStyles(styles)(AlertModal)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { AlertModal, styles, options } from '.'
|
2
|
+
options
|
3
|
+
|
4
|
+
import {
|
5
|
+
getTemplate,
|
6
|
+
getListTemplate,
|
7
|
+
getOptionsArgTypes,
|
8
|
+
} from '../../helpers/storybook'
|
9
|
+
|
10
|
+
const Template = getTemplate(AlertModal, styles)
|
11
|
+
const ListTemplate = getListTemplate(AlertModal, styles)
|
12
|
+
|
13
|
+
export default {
|
14
|
+
title: 'Atoms/AlertModal',
|
15
|
+
component: AlertModal,
|
16
|
+
args: {
|
17
|
+
titleAlert: 'Felicidades!',
|
18
|
+
subTitleAlert: 'Ejemplo de subtitulo',
|
19
|
+
txtBtnAlert: 'Aceptar',
|
20
|
+
// resultIsConfirmed: true,
|
21
|
+
// resultIsDenied: '',
|
22
|
+
},
|
23
|
+
argTypes: {
|
24
|
+
iconAlert: getOptionsArgTypes(options.icon),
|
25
|
+
},
|
26
|
+
}
|
27
|
+
|
28
|
+
export const Default = Template.bind({})
|
29
|
+
// export const List = ListTemplate.bind({})
|
30
|
+
// List.args = { items: options.types.map((type) => ({ type })) }
|
package/atoms/Button/Button.js
CHANGED
@@ -24,6 +24,8 @@ export const Button = ({
|
|
24
24
|
getStyles,
|
25
25
|
}) => (
|
26
26
|
<button
|
27
|
+
type="submit"
|
28
|
+
disabled={isMuted}
|
27
29
|
className={getStyles('button', ['type'], {
|
28
30
|
'is-inline': isInline || type === 'tertiary',
|
29
31
|
'is-muted': isMuted && type === 'primary',
|
@@ -37,6 +39,7 @@ export const Button = ({
|
|
37
39
|
isCentered
|
38
40
|
isInline={isObject(addons) && !isEmpty(addons)}
|
39
41
|
weight={'light'}
|
42
|
+
size={'xs'}
|
40
43
|
>
|
41
44
|
{children}
|
42
45
|
</Heading>
|
@@ -60,8 +63,8 @@ Button.propTypes = {
|
|
60
63
|
|
61
64
|
Button.defaultProps = {
|
62
65
|
type: 'primary',
|
63
|
-
getStyles: () => {},
|
64
|
-
onClick: () => {},
|
66
|
+
getStyles: () => { },
|
67
|
+
onClick: () => { },
|
65
68
|
isInline: false,
|
66
69
|
}
|
67
70
|
|
@@ -2,10 +2,10 @@
|
|
2
2
|
display: inline-flex;
|
3
3
|
width: 100%;
|
4
4
|
min-width: max-content;
|
5
|
-
height:
|
5
|
+
height: 40px;
|
6
6
|
align-items: center;
|
7
7
|
justify-content: center;
|
8
|
-
padding:
|
8
|
+
padding: 12px 30px;
|
9
9
|
border: var(--border-width-thin) solid var(--color-base-transparent);
|
10
10
|
border-radius: var(--button-border-radius-none);
|
11
11
|
box-shadow: var(--box-shadow-sm);
|
@@ -59,5 +59,8 @@
|
|
59
59
|
}
|
60
60
|
|
61
61
|
.is-muted {
|
62
|
-
background: var(--color-
|
62
|
+
background: var(--color-font-muted);
|
63
|
+
cursor: default;
|
64
|
+
box-shadow: var(--box-shadow-none) !important;
|
65
|
+
filter: brightness(1) !important;
|
63
66
|
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import styles from './Checkbox.module.css'
|
5
|
+
import { options } from './constants'
|
6
|
+
import withStyles from '../../hocs/withStyles'
|
7
|
+
|
8
|
+
|
9
|
+
export const Checkbox = ({ getStyles, onChange, label, id, value, name, linkCheck, nameLinkCheck }) => {
|
10
|
+
|
11
|
+
const [checked, setChecked] = React.useState(false);
|
12
|
+
|
13
|
+
|
14
|
+
return (
|
15
|
+
|
16
|
+
<div className={getStyles('checkbox')}>
|
17
|
+
|
18
|
+
{/* <input
|
19
|
+
type="checkbox"
|
20
|
+
id={id}
|
21
|
+
name={name}
|
22
|
+
label={label}
|
23
|
+
value={value}
|
24
|
+
onChange={onChange}
|
25
|
+
/>
|
26
|
+
{label} */}
|
27
|
+
|
28
|
+
<input className={getStyles('checkbox-custom')}
|
29
|
+
type="checkbox"
|
30
|
+
id={id}
|
31
|
+
name={name}
|
32
|
+
label={label}
|
33
|
+
value={value}
|
34
|
+
onChange={onChange}
|
35
|
+
/>
|
36
|
+
<label htmlFor={name} className={getStyles('checkbox-custom-label')}>{label}<a className={getStyles('checkbox-custom-link')} href={linkCheck} target="_black"> {nameLinkCheck}</a> </label>
|
37
|
+
|
38
|
+
|
39
|
+
</div>
|
40
|
+
|
41
|
+
)
|
42
|
+
}
|
43
|
+
|
44
|
+
Checkbox.propTypes = {
|
45
|
+
getStyles: PropTypes.func.isRequired,
|
46
|
+
onChange: PropTypes.func.isRequired,
|
47
|
+
id: PropTypes.string.isRequired,
|
48
|
+
name: PropTypes.string.isRequired,
|
49
|
+
value: PropTypes.bool.isRequired,
|
50
|
+
label: PropTypes.string,
|
51
|
+
nameLinkCheck: PropTypes.string,
|
52
|
+
linkCheck: PropTypes.string,
|
53
|
+
}
|
54
|
+
|
55
|
+
Checkbox.defaultProps = {
|
56
|
+
getStyles: () => { },
|
57
|
+
onChange: () => { },
|
58
|
+
id: 'hola',
|
59
|
+
name: 'hola',
|
60
|
+
value: true,
|
61
|
+
label: 'Hola',
|
62
|
+
nameLinkCheck: '',
|
63
|
+
linkCheck: '',
|
64
|
+
}
|
65
|
+
|
66
|
+
export default withStyles(styles)(Checkbox)
|
@@ -0,0 +1,54 @@
|
|
1
|
+
.checkbox {
|
2
|
+
display: flex;
|
3
|
+
}
|
4
|
+
|
5
|
+
/* ////////////////////// */
|
6
|
+
|
7
|
+
|
8
|
+
.checkbox-custom {
|
9
|
+
opacity: 0;
|
10
|
+
position: absolute;
|
11
|
+
}
|
12
|
+
|
13
|
+
.checkbox-custom, .checkbox-custom-label {
|
14
|
+
display: inline-block;
|
15
|
+
vertical-align: middle;
|
16
|
+
margin: 5px;
|
17
|
+
cursor: pointer;
|
18
|
+
color: var(--color-brand-regent-gray);
|
19
|
+
font-weight: var(--font-weight-light);
|
20
|
+
}
|
21
|
+
|
22
|
+
.checkbox-custom + .checkbox-custom-label:before {
|
23
|
+
content: '';
|
24
|
+
background: #fff;
|
25
|
+
border-radius: 5px;
|
26
|
+
border: 2px solid #ddd;
|
27
|
+
display: inline-block;
|
28
|
+
vertical-align: middle;
|
29
|
+
width: 10px;
|
30
|
+
height: 10px;
|
31
|
+
padding: 2px;
|
32
|
+
margin-right: 10px;
|
33
|
+
text-align: center;
|
34
|
+
}
|
35
|
+
|
36
|
+
.checkbox-custom:checked + .checkbox-custom-label:before {
|
37
|
+
content: "";
|
38
|
+
display: inline-block;
|
39
|
+
width: 1px;
|
40
|
+
height: 5px;
|
41
|
+
border: solid var(--color-brand-smalt);
|
42
|
+
border-width: 0 3px 3px 0;
|
43
|
+
transform: rotate(45deg);
|
44
|
+
-webkit-transform: rotate(45deg);
|
45
|
+
-ms-transform: rotate(45deg);
|
46
|
+
border-radius: 0px;
|
47
|
+
margin: 0px 15px 5px 5px;
|
48
|
+
}
|
49
|
+
|
50
|
+
.checkbox-custom, .checkbox-custom-link {
|
51
|
+
font-weight: var(--font-weight-normal);
|
52
|
+
color: var(--color-primary);
|
53
|
+
text-decoration: underline;
|
54
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { Checkbox, styles, options } from '.'
|
2
|
+
|
3
|
+
import {
|
4
|
+
getTemplate,
|
5
|
+
getListTemplate,
|
6
|
+
getOptionsArgTypes,
|
7
|
+
} from '../../helpers/storybook'
|
8
|
+
|
9
|
+
const Template = getTemplate(Checkbox, styles)
|
10
|
+
const ListTemplate = getListTemplate(Checkbox, styles)
|
11
|
+
|
12
|
+
export default {
|
13
|
+
title: 'Atoms/Checkbox',
|
14
|
+
component: Checkbox,
|
15
|
+
args: {
|
16
|
+
id: 'hola',
|
17
|
+
name: 'hola',
|
18
|
+
value: true,
|
19
|
+
label: 'Hola',
|
20
|
+
nameLinkCheck: '',
|
21
|
+
linkCheck: '',
|
22
|
+
},
|
23
|
+
argTypes: {
|
24
|
+
// types: getOptionsArgTypes(options.types),
|
25
|
+
},
|
26
|
+
}
|
27
|
+
|
28
|
+
export const Default = Template.bind({})
|
29
|
+
// export const List = ListTemplate.bind({})
|
30
|
+
// List.args = { items: options.types.map((type) => ({ type })) }
|
@@ -0,0 +1 @@
|
|
1
|
+
export const options = { types: [] }
|
package/atoms/Heading/Heading.js
CHANGED
@@ -19,7 +19,7 @@ export const Heading = ({ children, isCentered, isInline, getStyles }) => {
|
|
19
19
|
}
|
20
20
|
|
21
21
|
Heading.propTypes = {
|
22
|
-
children: PropTypes.
|
22
|
+
children: PropTypes.any.isRequired,
|
23
23
|
getStyles: PropTypes.func.isRequired,
|
24
24
|
isInline: PropTypes.bool,
|
25
25
|
isCentered: PropTypes.bool,
|
package/atoms/Icon/constants.js
CHANGED
@@ -59,18 +59,18 @@ export const iconsMap = {
|
|
59
59
|
d="M5,10L15,0l0.9,0.9L6.8,10l9.1,9.1L15,20L5,10z"
|
60
60
|
/>
|
61
61
|
|
62
|
-
|
62
|
+
|
63
63
|
),
|
64
64
|
},
|
65
65
|
angleRight: {
|
66
66
|
viewBox: '0 0 20 20',
|
67
67
|
svg: (
|
68
68
|
|
69
|
-
<path
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
<path
|
70
|
+
fillRule="evenodd"
|
71
|
+
clipRule="evenodd"
|
72
|
+
d="M15.9,10l-10,10L5,19.1l9.1-9.1L5,0.9L5.9,0C5.9,0,15.9,10,15.9,10z"
|
73
|
+
/>
|
74
74
|
|
75
75
|
|
76
76
|
),
|
@@ -85,6 +85,30 @@ export const iconsMap = {
|
|
85
85
|
/>
|
86
86
|
),
|
87
87
|
},
|
88
|
+
angleUpDown: {
|
89
|
+
viewBox: '0 0 15 15',
|
90
|
+
svg: (
|
91
|
+
<path d="M3.6,4.3c-0.3,0.3-0.3,0.7,0,1c0.3,0.3,0.7,0.3,1,0l2.9-2.9l2.9,2.9c0.3,0.3,0.7,0.3,1,0c0.3-0.3,0.3-0.7,0-1
|
92
|
+
L8,0.9C7.9,0.8,7.7,0.7,7.5,0.7C7.3,0.7,7.1,0.8,7,0.9L3.6,4.3z M11.4,10.7c0.3-0.3,0.3-0.7,0-1c-0.3-0.3-0.7-0.3-1,0l-2.9,2.9
|
93
|
+
L4.6,9.7c-0.3-0.3-0.7-0.3-1,0c-0.3,0.3-0.3,0.7,0,1L7,14.1c0.3,0.3,0.7,0.3,1,0L11.4,10.7z"/>
|
94
|
+
),
|
95
|
+
},
|
96
|
+
|
97
|
+
fileDownload: {
|
98
|
+
viewBox: '0 0 21 21',
|
99
|
+
svg: (
|
100
|
+
<g transform="translate(4 2)">
|
101
|
+
<path d="M11.7,18.8H1.3c-1.7,0-3.1-1.4-3.1-3.1v-13c0-1.7,1.4-3.1,3.1-3.1h2.6c0.3,0,0.5,0.2,0.5,0.5S4.2,0.5,3.9,0.5H1.3
|
102
|
+
c-1.2,0-2.1,0.9-2.1,2.1v13c0,1.2,0.9,2.1,2.1,2.1h10.4c1.2,0,2.1-0.9,2.1-2.1l0-10.2L8.8,0.4c-0.2-0.2-0.2-0.5,0-0.7
|
103
|
+
s0.5-0.2,0.7,0l5.2,5.2c0.1,0.1,0.1,0.2,0.1,0.4l0,10.4C14.8,17.4,13.4,18.8,11.7,18.8z"/>
|
104
|
+
<path d="M6.5,13.6c-0.1,0-0.3,0-0.3-0.1L2.2,9.6C2,9.4,2,9.1,2.2,8.9c0.2-0.2,0.5-0.2,0.7,0l3.6,3.5l3.6-3.5c0.2-0.2,0.5-0.2,0.7,0
|
105
|
+
c0.2,0.2,0.2,0.5,0,0.7l-3.9,3.8C6.8,13.5,6.6,13.6,6.5,13.6z"/>
|
106
|
+
<path d="M6.5,13.6c-0.3,0-0.5-0.2-0.5-0.5V-1.3c0-0.3,0.2-0.5,0.5-0.5S7-1.6,7-1.3v14.3C7,13.3,6.8,13.6,6.5,13.6z" />
|
107
|
+
</g>
|
108
|
+
),
|
109
|
+
},
|
110
|
+
|
111
|
+
|
88
112
|
pauseCircle: {
|
89
113
|
viewBox: '0 0 28 28',
|
90
114
|
svg: (
|
package/atoms/Input/Input.js
CHANGED
@@ -5,44 +5,61 @@ import styles from './Input.module.css'
|
|
5
5
|
import { options } from './constants'
|
6
6
|
import withStyles from '../../hocs/withStyles'
|
7
7
|
|
8
|
-
const handleChange = ({ onChange }) => () => {
|
9
|
-
|
10
|
-
}
|
8
|
+
// const handleChange = ({ onChange }) => () => {
|
9
|
+
// onChange()
|
10
|
+
// }
|
11
11
|
|
12
12
|
export const Input = ({
|
13
13
|
getStyles,
|
14
14
|
type,
|
15
|
+
id,
|
15
16
|
value,
|
16
17
|
isInline,
|
18
|
+
isInlineCode,
|
19
|
+
isInputFilter,
|
17
20
|
onChange,
|
21
|
+
onClick,
|
18
22
|
placeholder,
|
23
|
+
pattern,
|
19
24
|
}) => (
|
20
25
|
<input
|
21
26
|
className={getStyles('input', {
|
22
27
|
'is-inline': isInline,
|
28
|
+
'is-inline-code': isInlineCode,
|
29
|
+
'is-input-filter': isInputFilter,
|
23
30
|
})}
|
24
31
|
type={type}
|
32
|
+
id={id}
|
25
33
|
value={value}
|
26
34
|
placeholder={placeholder}
|
27
|
-
onChange={
|
35
|
+
onChange={onChange}
|
36
|
+
onClick={onClick}
|
28
37
|
></input>
|
29
38
|
)
|
30
39
|
|
31
40
|
Input.propTypes = {
|
32
41
|
onChange: PropTypes.func.isRequired,
|
42
|
+
onClick: PropTypes.func,
|
33
43
|
getStyles: PropTypes.func.isRequired,
|
34
44
|
type: PropTypes.oneOf(options.types),
|
45
|
+
id: PropTypes.string.isRequired,
|
35
46
|
value: PropTypes.string,
|
36
47
|
placeholder: PropTypes.string,
|
37
48
|
isInline: PropTypes.bool,
|
49
|
+
isInlineCode: PropTypes.bool,
|
50
|
+
isInputFilter: PropTypes.bool,
|
38
51
|
}
|
39
52
|
|
40
53
|
Input.defaultProps = {
|
41
54
|
type: 'text',
|
42
|
-
value: '',
|
55
|
+
// value: '',
|
56
|
+
id: '',
|
43
57
|
placeholder: '',
|
44
58
|
isInline: false,
|
59
|
+
isInlineCode: false,
|
60
|
+
isInputFilter: false,
|
45
61
|
onChange: () => {},
|
62
|
+
onClick: () => {},
|
46
63
|
getStyles: () => {},
|
47
64
|
}
|
48
65
|
|
@@ -1,20 +1,21 @@
|
|
1
1
|
.input {
|
2
2
|
width: 100%;
|
3
3
|
height: var(--input-height);
|
4
|
-
padding:
|
5
|
-
border: var(--border-width-thin) solid var(--color-
|
4
|
+
padding: 10px 17px;
|
5
|
+
border: var(--border-width-thin) solid var(--color-brand-white-lilac);
|
6
6
|
background: var(--input-background);
|
7
|
-
border-radius: var(--input-border-radius);
|
7
|
+
/* border-radius: var(--input-border-radius); */
|
8
8
|
color: var(--color-font-base);
|
9
9
|
font-family: var(--font-family-sans);
|
10
|
-
font-size: var(--
|
10
|
+
font-size: var(--font-size-base);
|
11
11
|
font-weight: var(--font-weight-medium);
|
12
|
-
line-height: var(--line-height-
|
12
|
+
line-height: var(--line-height-relaxed);
|
13
13
|
transition: box-shadow 0.2s ease;
|
14
14
|
}
|
15
15
|
|
16
16
|
.input::placeholder {
|
17
|
-
color: var(--color-
|
17
|
+
color: var(--color-brand-white-lilac);
|
18
|
+
font-weight: var(--font-weight-light);
|
18
19
|
}
|
19
20
|
|
20
21
|
.input:focus {
|
@@ -25,3 +26,22 @@
|
|
25
26
|
.is-inline {
|
26
27
|
max-width: max-content;
|
27
28
|
}
|
29
|
+
|
30
|
+
.is-inline-code {
|
31
|
+
max-width: 38px;
|
32
|
+
padding: 7px 9px;
|
33
|
+
margin-right: 8px;
|
34
|
+
font-size: var(--font-size-md);
|
35
|
+
font-weight: var(--font-weight-bold);
|
36
|
+
text-align: center;
|
37
|
+
}
|
38
|
+
|
39
|
+
.is-input-filter {
|
40
|
+
border-radius: var(--border-radius-sm);
|
41
|
+
color: var(--color-font-highlight);
|
42
|
+
padding: 7px 9px;
|
43
|
+
font-size: var(--font-size-base);
|
44
|
+
font-weight: var(--font-weight-light);
|
45
|
+
text-align: left;
|
46
|
+
height: 28px;
|
47
|
+
}
|
@@ -13,7 +13,7 @@ export default {
|
|
13
13
|
title: 'Atoms/Input',
|
14
14
|
component: Input,
|
15
15
|
args: {
|
16
|
-
placeholder: '
|
16
|
+
placeholder: 'Et harum quidem',
|
17
17
|
},
|
18
18
|
argTypes: {
|
19
19
|
type: getOptionsArgTypes(options.types),
|
@@ -23,10 +23,16 @@ export default {
|
|
23
23
|
export const Default = Template.bind({})
|
24
24
|
|
25
25
|
export const Value = Template.bind({})
|
26
|
-
Value.args = { value: '
|
26
|
+
Value.args = { value: 'Nam libero tempore, cum soluta.' }
|
27
27
|
|
28
28
|
export const Types = ListTemplate.bind({})
|
29
29
|
Types.args = { items: options.types.map((type) => ({ type })) }
|
30
30
|
|
31
31
|
export const Inline = Template.bind({})
|
32
32
|
Inline.args = { isInline: true }
|
33
|
+
|
34
|
+
export const InlineCode = Template.bind({})
|
35
|
+
InlineCode.args = { isInlineCode: true }
|
36
|
+
|
37
|
+
export const isInputFilter = Template.bind({})
|
38
|
+
isInputFilter.args = { isisInputFilter: true }
|
@@ -18,7 +18,7 @@ exports[`Storyshots Atoms/Input Default 1`] = `
|
|
18
18
|
<input
|
19
19
|
className="input"
|
20
20
|
onChange={[Function]}
|
21
|
-
placeholder="
|
21
|
+
placeholder="Et harum quidem"
|
22
22
|
type="text"
|
23
23
|
value=""
|
24
24
|
/>
|
@@ -43,7 +43,7 @@ exports[`Storyshots Atoms/Input Inline 1`] = `
|
|
43
43
|
<input
|
44
44
|
className="input is-inline"
|
45
45
|
onChange={[Function]}
|
46
|
-
placeholder="
|
46
|
+
placeholder="Et harum quidem"
|
47
47
|
type="text"
|
48
48
|
value=""
|
49
49
|
/>
|
@@ -68,7 +68,7 @@ exports[`Storyshots Atoms/Input Types 1`] = `
|
|
68
68
|
<input
|
69
69
|
className="input"
|
70
70
|
onChange={[Function]}
|
71
|
-
placeholder="
|
71
|
+
placeholder="Et harum quidem"
|
72
72
|
type="text"
|
73
73
|
value=""
|
74
74
|
/>
|
@@ -93,9 +93,9 @@ exports[`Storyshots Atoms/Input Value 1`] = `
|
|
93
93
|
<input
|
94
94
|
className="input"
|
95
95
|
onChange={[Function]}
|
96
|
-
placeholder="
|
96
|
+
placeholder="Et harum quidem"
|
97
97
|
type="text"
|
98
|
-
value="
|
98
|
+
value="Nam libero tempore, cum soluta."
|
99
99
|
/>
|
100
100
|
</div>
|
101
101
|
`;
|
package/atoms/Input/constants.js
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import styles from './Label.module.css'
|
5
|
+
import { options } from './constants'
|
6
|
+
import withStyles from '../../hocs/withStyles'
|
7
|
+
|
8
|
+
export const Label = ({ children, getStyles, isHint }) => {
|
9
|
+
return (
|
10
|
+
|
11
|
+
<label className={getStyles('label', ['color'], { 'is-hint': isHint })}>{children}</label>
|
12
|
+
|
13
|
+
)
|
14
|
+
}
|
15
|
+
|
16
|
+
Label.propTypes = {
|
17
|
+
children: PropTypes.string,
|
18
|
+
getStyles: PropTypes.func.isRequired,
|
19
|
+
isHint: PropTypes.bool,
|
20
|
+
color: PropTypes.oneOf(options.colors),
|
21
|
+
// type: PropTypes.oneOf(options.types),
|
22
|
+
}
|
23
|
+
|
24
|
+
Label.defaultProps = {
|
25
|
+
getStyles: () => {},
|
26
|
+
children: 'label example',
|
27
|
+
isHint: false,
|
28
|
+
color: 'label',
|
29
|
+
}
|
30
|
+
|
31
|
+
export default withStyles(styles)(Label)
|