imbric-theme 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- package/.dockerignore +14 -0
- package/.eslintignore +1 -0
- package/.prettierignore +1 -0
- package/.storybook/main.js +6 -2
- package/.storybook/preview.js +21 -0
- package/.vscode/settings.json +3 -0
- package/Dockerfile +17 -0
- package/atoms/AlertModal/AlertModal.js +69 -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 +17 -2
- package/atoms/Button/Button.module.css +25 -3
- package/atoms/Button/Button.stories.js +1 -1
- package/atoms/Button/__snapshots__/Button.stories.js.snap +8 -8
- package/atoms/Check/Check.js +6 -4
- package/atoms/Checkbox/Checkbox.js +83 -0
- package/atoms/Checkbox/Checkbox.module.css +60 -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/Divider/Divider.js +5 -2
- package/atoms/Divider/Divider.module.css +20 -0
- package/atoms/Divider/Divider.stories.js +13 -2
- package/atoms/Divider/constants.js +3 -0
- package/atoms/Divider/index.js +1 -0
- package/atoms/Heading/Heading.js +1 -1
- package/atoms/Heading/Heading.module.css +4 -0
- package/atoms/Heading/Heading.stories.js +2 -2
- package/atoms/Heading/__snapshots__/Heading.stories.js.snap +16 -16
- package/atoms/Heading/constants.js +1 -1
- package/atoms/Icon/Icon.js +1 -1
- package/atoms/Icon/Icon.module.css +30 -0
- package/atoms/Icon/constants.js +750 -145
- package/atoms/Input/Input.js +195 -15
- package/atoms/Input/Input.module.css +62 -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 +42 -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 +38 -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/LinkItem/index.js +3 -0
- package/atoms/Modal/Modal.js +27 -4
- package/atoms/Modal/Modal.module.css +63 -6
- package/atoms/Paragraph/Paragraph.module.css +4 -0
- package/atoms/Paragraph/Paragraph.stories.js +2 -2
- package/atoms/Paragraph/__snapshots__/Paragraph.stories.js.snap +16 -16
- package/atoms/Picture/Picture.js +15 -2
- package/atoms/Tab/Tab.js +41 -0
- package/atoms/Tab/Tab.module.css +17 -0
- package/atoms/Tab/Tab.stories.js +27 -0
- package/atoms/Tab/constants.js +1 -0
- package/atoms/Tab/index.js +3 -0
- package/atoms/Textarea/Textarea.js +106 -15
- package/atoms/Textarea/Textarea.module.css +31 -2
- package/atoms/Toggle/Toggle.js +56 -0
- package/atoms/Toggle/Toggle.module.css +41 -0
- package/atoms/Toggle/Toggle.stories.js +21 -0
- package/atoms/Toggle/constants.js +1 -0
- package/atoms/Toggle/index.js +3 -0
- package/helpers/storybook.js +2 -2
- package/hook/useAddColumn.js +40 -0
- package/hook/useStateDate.js +25 -0
- package/hook/useTable.js +54 -0
- package/index.js +41 -1
- package/jest.config.js +1 -1
- package/layout/DynamicTable/DynamicTable.js +372 -0
- package/layout/DynamicTable/DynamicTable.module.css +62 -0
- package/layout/DynamicTable/DynamicTable.stories.js +79 -0
- package/layout/DynamicTable/constants.js +323 -0
- package/layout/DynamicTable/index.js +3 -0
- package/layout/FlexColumnContent/FlexColumnContent.js +26 -0
- package/layout/FlexColumnContent/FlexColumnContent.module.css +5 -0
- package/layout/FlexColumnContent/FlexColumnContent.stories.js +28 -0
- package/layout/FlexColumnContent/constants.js +1 -0
- package/layout/FlexColumnContent/index.js +3 -0
- package/layout/Navbar/Navbar.js +247 -0
- package/layout/Navbar/Navbar.module.css +35 -0
- package/layout/Navbar/Navbar.stories.js +20 -0
- package/layout/Navbar/constants.js +35 -0
- package/layout/Navbar/index.js +2 -0
- package/layout/Sidebar/Sidebar.js +115 -0
- package/layout/Sidebar/Sidebar.module.css +387 -0
- package/layout/Sidebar/Sidebar.stories.js +28 -0
- package/layout/Sidebar/constants.js +228 -0
- package/layout/Sidebar/index.js +3 -0
- package/molecules/Accordion/Accordion.js +11 -11
- package/molecules/CardDefault/CardDefault.js +65 -0
- package/molecules/CardDefault/CardDefault.module.css +19 -0
- package/molecules/CardDefault/CardDefault.stories.js +23 -0
- package/molecules/CardDefault/constants.js +1 -0
- package/molecules/CardDefault/index.js +3 -0
- package/molecules/CardProductTypesBooking/CardProductTypesBooking.js +89 -0
- package/molecules/CardProductTypesBooking/CardProductTypesBooking.module.css +118 -0
- package/molecules/CardProductTypesBooking/CardProductTypesBooking.stories.js +25 -0
- package/molecules/CardProductTypesBooking/constants.js +1 -0
- package/molecules/CardProductTypesBooking/index.js +3 -0
- package/molecules/CardServiceDetail/CardServiceDetail.js +400 -0
- package/molecules/CardServiceDetail/CardServiceDetail.module.css +222 -0
- package/molecules/CardServiceDetail/CardServiceDetail.stories.js +23 -0
- package/molecules/CardServiceDetail/constants.js +1 -0
- package/molecules/CardServiceDetail/index.js +3 -0
- package/molecules/CardServices/CardServices.js +461 -0
- package/molecules/CardServices/CardServices.module.css +213 -0
- package/molecules/CardServices/CardServices.stories.js +41 -0
- package/molecules/CardServices/constants.js +5 -0
- package/molecules/CardServices/index.js +3 -0
- package/molecules/CardServicesFinalized/CardServicesFinalized.js +381 -0
- package/molecules/CardServicesFinalized/CardServicesFinalized.module.css +213 -0
- package/molecules/CardServicesFinalized/CardServicesFinalized.stories.js +23 -0
- package/molecules/CardServicesFinalized/constants.js +1 -0
- package/molecules/CardServicesFinalized/index.js +3 -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 +155 -0
- package/molecules/ColumnTable/ColumnTable.module.css +52 -0
- package/molecules/ColumnTable/ColumnTable.stories.js +26 -0
- package/molecules/ColumnTable/constants.js +117 -0
- package/molecules/ColumnTable/index.js +3 -0
- package/molecules/DatePicker/DatePicker.js +242 -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/DatePickerTime/DatePickerTime.js +133 -0
- package/molecules/DatePickerTime/DatePickerTime.module.css +3 -0
- package/molecules/DatePickerTime/DatePickerTime.stories.js +18 -0
- package/molecules/DatePickerTime/constants.js +1 -0
- package/molecules/DatePickerTime/index.js +3 -0
- package/molecules/Dropdown/Dropdown.js +26 -23
- package/molecules/Dropdown/Dropdown.module.css +21 -3
- package/molecules/DynamicSelect/DynamicSelect.js +186 -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 +166 -0
- package/molecules/FooterTable/FooterTable.module.css +63 -0
- package/molecules/FooterTable/FooterTable.stories.js +23 -0
- package/molecules/FooterTable/constants.js +9 -0
- package/molecules/FooterTable/index.js +3 -0
- package/molecules/InputAutocomplete/InputAutocomplete.js +221 -0
- package/molecules/InputAutocomplete/InputAutocomplete.module.css +55 -0
- package/molecules/InputAutocomplete/InputAutocomplete.stories.js +23 -0
- package/molecules/InputAutocomplete/constants.js +1 -0
- package/molecules/InputAutocomplete/index.js +3 -0
- package/molecules/ItemMenu/ItemMenu.js +134 -0
- package/molecules/ItemMenu/ItemMenu.module.css +363 -0
- package/molecules/ItemMenu/ItemMenu.stories.js +42 -0
- package/molecules/ItemMenu/constants.js +36 -0
- package/molecules/ItemMenu/index.js +3 -0
- package/molecules/RowTable/RowTable.js +1057 -0
- package/molecules/RowTable/RowTable.module.css +63 -0
- package/molecules/RowTable/RowTable.stories.js +26 -0
- package/molecules/RowTable/constants.js +798 -0
- package/molecules/RowTable/index.js +3 -0
- package/molecules/Tabs/Tabs.js +59 -0
- package/molecules/Tabs/Tabs.module.css +13 -0
- package/molecules/Tabs/Tabs.stories.js +34 -0
- package/molecules/Tabs/constants.js +34 -0
- package/molecules/Tabs/index.js +3 -0
- package/package.json +33 -16
- 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/favicon.ico +0 -0
- package/public/static/google-maps.png +0 -0
- package/public/static/images/folders-folder.svg +26 -0
- package/public/static/images/permissions.svg +14 -0
- package/public/static/images/reports-results.svg +18 -0
- package/public/static/logo.svg +19 -0
- package/public/static/logologin.png +0 -0
- package/public/static/logologin.svg +16 -0
- package/public/static/logologintagos.svg +19 -0
- package/public/static/logotipo.svg +50 -0
- package/public/static/logotipoS.svg +26 -0
- package/public/static/taxisvalencia_logod.png +0 -0
- package/scripts/create-component.js +2 -1
- package/styles/GrupoMutua.css +391 -0
- package/styles/default.css +391 -0
- package/styles/globals.css +1514 -0
- package/styles/radiotaxiaragon.css +391 -0
- package/styles/spartan.css +391 -0
- package/styles/tagos.css +391 -0
- package/styles/taxisvalencia.css +391 -0
- package/styles/tokens.css +2 -1
- package/tokens/index.js +2 -1
- package/.eslintcache +0 -1
- package/atoms/Link/Link.js +0 -33
- package/atoms/Link/index.js +0 -3
- /package/atoms/{Link → LinkItem}/__snapshots__/Link.stories.js.snap +0 -0
- /package/atoms/{Link → LinkItem}/constants.js +0 -0
package/.dockerignore
ADDED
package/.eslintignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
node_modules
|
package/.prettierignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
node_modules
|
package/.storybook/main.js
CHANGED
@@ -3,7 +3,11 @@ 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)'],
|
7
|
-
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
6
|
+
stories: ['../{tokens,atoms,molecules,layout,pages}/**/*.stories.@(js|mdx)'],
|
7
|
+
addons: ['@storybook/addon-links', '@storybook/addon-essentials', 'storybook-addon-theme-changer'],
|
8
|
+
staticDirs: ['../public'],
|
8
9
|
webpackFinal: loadConfigs([cssModules, reactInlineSvg]),
|
10
|
+
features: {
|
11
|
+
postcss: false,
|
12
|
+
},
|
9
13
|
}
|
package/.storybook/preview.js
CHANGED
@@ -3,6 +3,13 @@ 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'
|
10
|
+
import '../styles/default.css'
|
11
|
+
import '../styles/tagos.css'
|
12
|
+
|
6
13
|
|
7
14
|
const getStyles = ({ __sb } = {}) => ({
|
8
15
|
display: 'flex',
|
@@ -30,3 +37,17 @@ export const parameters = {
|
|
30
37
|
},
|
31
38
|
actions: { argTypesRegex: '^on[A-Z].*' },
|
32
39
|
}
|
40
|
+
|
41
|
+
export const globalTypes = {
|
42
|
+
themes: {
|
43
|
+
defaultValue: [
|
44
|
+
"Imbric",
|
45
|
+
"Default",
|
46
|
+
"GrupoMutua",
|
47
|
+
"Taxisvalencia",
|
48
|
+
"Radiotaxiaragon",
|
49
|
+
"Spartan",
|
50
|
+
"Tagos",
|
51
|
+
],
|
52
|
+
}
|
53
|
+
}
|
package/Dockerfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
FROM node:18-alpine
|
2
|
+
|
3
|
+
## set environment stage
|
4
|
+
ENV PATH /app/node_modules/.bin:$PATH
|
5
|
+
ENV NODE_OPTIONS --openssl-legacy-provider
|
6
|
+
WORKDIR /app
|
7
|
+
COPY . /app/
|
8
|
+
|
9
|
+
## build app stage
|
10
|
+
RUN yarn install --network-timeout 200000 \
|
11
|
+
&& yarn build
|
12
|
+
|
13
|
+
## final image stage
|
14
|
+
FROM nginx:alpine
|
15
|
+
COPY --from=0 /app/storybook-static/ /usr/share/nginx/html/
|
16
|
+
|
17
|
+
EXPOSE 80
|
@@ -0,0 +1,69 @@
|
|
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 AlertModal = ({
|
11
|
+
children,
|
12
|
+
getStyles,
|
13
|
+
titleAlert,
|
14
|
+
subTitleAlert,
|
15
|
+
iconAlert,
|
16
|
+
txtBtnAlert,
|
17
|
+
txtBtnAlertCancel,
|
18
|
+
showCancelButton,
|
19
|
+
onConfirm,
|
20
|
+
onDismiss,
|
21
|
+
}) => {
|
22
|
+
|
23
|
+
const MySwal = withReactContent(Swal)
|
24
|
+
|
25
|
+
MySwal.fire({
|
26
|
+
title: titleAlert,
|
27
|
+
icon: iconAlert,
|
28
|
+
html: subTitleAlert,
|
29
|
+
confirmButtonText: txtBtnAlert,
|
30
|
+
cancelButtonText: txtBtnAlertCancel,
|
31
|
+
showCancelButton: showCancelButton,
|
32
|
+
}).then((result) => {
|
33
|
+
if (result.isConfirmed || (result.isDismissed && !onDismiss)) {
|
34
|
+
onConfirm()
|
35
|
+
} else if (result.isDismissed) {
|
36
|
+
onDismiss()
|
37
|
+
}
|
38
|
+
})
|
39
|
+
|
40
|
+
|
41
|
+
return <div className={getStyles('alert-modal')}>{children}</div>
|
42
|
+
}
|
43
|
+
|
44
|
+
AlertModal.propTypes = {
|
45
|
+
children: PropTypes.node,
|
46
|
+
getStyles: PropTypes.func.isRequired,
|
47
|
+
titleAlert: PropTypes.string.isRequired,
|
48
|
+
subTitleAlert: PropTypes.string.isRequired,
|
49
|
+
txtBtnAlert: PropTypes.string.isRequired,
|
50
|
+
txtBtnAlertCancel: PropTypes.string,
|
51
|
+
iconAlert: PropTypes.oneOf(options.icon),
|
52
|
+
onConfirm: PropTypes.func,
|
53
|
+
onDismiss: PropTypes.func,
|
54
|
+
showCancelButton: PropTypes.bool,
|
55
|
+
}
|
56
|
+
|
57
|
+
AlertModal.defaultProps = {
|
58
|
+
getStyles: () => { },
|
59
|
+
onConfirm: () => { },
|
60
|
+
// onDismiss: () => {}, // Not default for use onConfirm if is undefined
|
61
|
+
titleAlert: 'Felicidades!',
|
62
|
+
subTitleAlert: 'Todo ha ido correctamente',
|
63
|
+
txtBtnAlert: 'Ok',
|
64
|
+
txtBtnAlertCancel: 'Cancelar',
|
65
|
+
iconAlert: 'success',
|
66
|
+
showCancelButton: false,
|
67
|
+
}
|
68
|
+
|
69
|
+
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
@@ -20,13 +20,21 @@ export const Button = ({
|
|
20
20
|
addons,
|
21
21
|
isMuted,
|
22
22
|
isInline,
|
23
|
+
isFloatRight,
|
24
|
+
isFloatLeft,
|
23
25
|
onClick,
|
26
|
+
id,
|
24
27
|
getStyles,
|
25
28
|
}) => (
|
26
29
|
<button
|
30
|
+
id={id}
|
31
|
+
type="submit"
|
32
|
+
disabled={isMuted}
|
27
33
|
className={getStyles('button', ['type'], {
|
28
34
|
'is-inline': isInline || type === 'tertiary',
|
29
35
|
'is-muted': isMuted && type === 'primary',
|
36
|
+
'is-float-right': isFloatRight,
|
37
|
+
'is-float-left': isFloatLeft,
|
30
38
|
})}
|
31
39
|
onClick={onClick && handleClick({ onClick })}
|
32
40
|
>
|
@@ -37,6 +45,7 @@ export const Button = ({
|
|
37
45
|
isCentered
|
38
46
|
isInline={isObject(addons) && !isEmpty(addons)}
|
39
47
|
weight={'light'}
|
48
|
+
size={'xs'}
|
40
49
|
>
|
41
50
|
{children}
|
42
51
|
</Heading>
|
@@ -56,13 +65,19 @@ Button.propTypes = {
|
|
56
65
|
onClick: PropTypes.func,
|
57
66
|
isInline: PropTypes.bool,
|
58
67
|
isMuted: PropTypes.bool,
|
68
|
+
isFloatRight: PropTypes.bool,
|
69
|
+
isFloatLeft: PropTypes.bool,
|
70
|
+
id: PropTypes.string,
|
59
71
|
}
|
60
72
|
|
61
73
|
Button.defaultProps = {
|
62
74
|
type: 'primary',
|
63
|
-
getStyles: () => {},
|
64
|
-
onClick: () => {},
|
75
|
+
getStyles: () => { },
|
76
|
+
onClick: () => { },
|
65
77
|
isInline: false,
|
78
|
+
isFloatRight: false,
|
79
|
+
isFloatLeft: false,
|
80
|
+
id: '',
|
66
81
|
}
|
67
82
|
|
68
83
|
export default withStyles(styles)(Button)
|
@@ -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);
|
@@ -13,6 +13,17 @@
|
|
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
|
+
[data-theme="Default"] .button {
|
24
|
+
border-radius: var(--button-border-radius-sm);
|
25
|
+
}
|
26
|
+
|
16
27
|
.button:focus {
|
17
28
|
box-shadow: 0 0 0 1px var(--color-primary), 0 0 10px 0 var(--color-primary);
|
18
29
|
outline: none;
|
@@ -59,5 +70,16 @@
|
|
59
70
|
}
|
60
71
|
|
61
72
|
.is-muted {
|
62
|
-
background: var(--color-
|
73
|
+
background: var(--color-font-muted);
|
74
|
+
cursor: default;
|
75
|
+
box-shadow: var(--box-shadow-none) !important;
|
76
|
+
filter: brightness(1) !important;
|
63
77
|
}
|
78
|
+
|
79
|
+
.is-float-right {
|
80
|
+
float: right;
|
81
|
+
}
|
82
|
+
|
83
|
+
.is-float-left {
|
84
|
+
float: left;
|
85
|
+
}
|
@@ -22,7 +22,7 @@ exports[`Storyshots Atoms/Button Addon Append 1`] = `
|
|
22
22
|
<h1
|
23
23
|
className="heading color-inverted size-md weight-light is-centered is-inline"
|
24
24
|
>
|
25
|
-
|
25
|
+
Sed ut perspiciatis unde!
|
26
26
|
</h1>
|
27
27
|
But ill-tempered Thengel.
|
28
28
|
</button>
|
@@ -52,7 +52,7 @@ exports[`Storyshots Atoms/Button Addon Prepend 1`] = `
|
|
52
52
|
<h1
|
53
53
|
className="heading color-inverted size-md weight-light is-centered is-inline"
|
54
54
|
>
|
55
|
-
|
55
|
+
Sed ut perspiciatis unde!
|
56
56
|
</h1>
|
57
57
|
</button>
|
58
58
|
</div>
|
@@ -80,7 +80,7 @@ exports[`Storyshots Atoms/Button Default 1`] = `
|
|
80
80
|
<h1
|
81
81
|
className="heading color-inverted size-md weight-light is-centered"
|
82
82
|
>
|
83
|
-
|
83
|
+
Sed ut perspiciatis unde!
|
84
84
|
</h1>
|
85
85
|
</button>
|
86
86
|
</div>
|
@@ -108,7 +108,7 @@ exports[`Storyshots Atoms/Button Inline 1`] = `
|
|
108
108
|
<h1
|
109
109
|
className="heading color-inverted size-md weight-light is-centered"
|
110
110
|
>
|
111
|
-
|
111
|
+
Sed ut perspiciatis unde!
|
112
112
|
</h1>
|
113
113
|
</button>
|
114
114
|
</div>
|
@@ -136,7 +136,7 @@ exports[`Storyshots Atoms/Button Muted 1`] = `
|
|
136
136
|
<h1
|
137
137
|
className="heading color-inverted size-md weight-light is-centered"
|
138
138
|
>
|
139
|
-
|
139
|
+
Sed ut perspiciatis unde!
|
140
140
|
</h1>
|
141
141
|
</button>
|
142
142
|
</div>
|
@@ -164,7 +164,7 @@ exports[`Storyshots Atoms/Button Types 1`] = `
|
|
164
164
|
<h1
|
165
165
|
className="heading color-inverted size-md weight-light is-centered"
|
166
166
|
>
|
167
|
-
|
167
|
+
Sed ut perspiciatis unde!
|
168
168
|
</h1>
|
169
169
|
</button>
|
170
170
|
<button
|
@@ -174,7 +174,7 @@ exports[`Storyshots Atoms/Button Types 1`] = `
|
|
174
174
|
<h1
|
175
175
|
className="heading color-primary size-md weight-light is-centered"
|
176
176
|
>
|
177
|
-
|
177
|
+
Sed ut perspiciatis unde!
|
178
178
|
</h1>
|
179
179
|
</button>
|
180
180
|
<button
|
@@ -184,7 +184,7 @@ exports[`Storyshots Atoms/Button Types 1`] = `
|
|
184
184
|
<h1
|
185
185
|
className="heading color-primary size-md weight-light is-centered"
|
186
186
|
>
|
187
|
-
|
187
|
+
Sed ut perspiciatis unde!
|
188
188
|
</h1>
|
189
189
|
</button>
|
190
190
|
</div>
|
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)
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { useState, useEffect } from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import styles from './Checkbox.module.css'
|
5
|
+
import withStyles from '../../hocs/withStyles'
|
6
|
+
|
7
|
+
export const Checkbox = ({
|
8
|
+
getStyles,
|
9
|
+
onChange,
|
10
|
+
label,
|
11
|
+
id,
|
12
|
+
value,
|
13
|
+
name,
|
14
|
+
linkCheck,
|
15
|
+
nameLinkCheck,
|
16
|
+
handleClick,
|
17
|
+
disabled,
|
18
|
+
}) => {
|
19
|
+
const [checked, setChecked] = useState(value)
|
20
|
+
|
21
|
+
useEffect(() => {
|
22
|
+
setChecked(value)
|
23
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
24
|
+
}, [value])
|
25
|
+
|
26
|
+
|
27
|
+
return (
|
28
|
+
<div className={getStyles('checkbox')}>
|
29
|
+
<input
|
30
|
+
className={getStyles('checkbox-custom', { 'is-disabled': disabled })}
|
31
|
+
type="checkbox"
|
32
|
+
id={id}
|
33
|
+
name={name}
|
34
|
+
label={label}
|
35
|
+
checked={checked}
|
36
|
+
onChange={(e) => {
|
37
|
+
setChecked(!checked)
|
38
|
+
onChange(e)
|
39
|
+
}}
|
40
|
+
onClick={handleClick}
|
41
|
+
disabled={disabled}
|
42
|
+
/>
|
43
|
+
<label htmlFor={name} className={getStyles('checkbox-custom-label')}>
|
44
|
+
{label}
|
45
|
+
<a
|
46
|
+
className={getStyles('checkbox-custom-link')}
|
47
|
+
href={linkCheck}
|
48
|
+
target="_black"
|
49
|
+
>
|
50
|
+
{' '}
|
51
|
+
{nameLinkCheck}
|
52
|
+
</a>{' '}
|
53
|
+
</label>
|
54
|
+
</div>
|
55
|
+
)
|
56
|
+
}
|
57
|
+
|
58
|
+
Checkbox.propTypes = {
|
59
|
+
getStyles: PropTypes.func.isRequired,
|
60
|
+
onChange: PropTypes.func.isRequired,
|
61
|
+
id: PropTypes.string.isRequired,
|
62
|
+
name: PropTypes.string.isRequired,
|
63
|
+
value: PropTypes.bool.isRequired,
|
64
|
+
label: PropTypes.string,
|
65
|
+
nameLinkCheck: PropTypes.string,
|
66
|
+
linkCheck: PropTypes.string,
|
67
|
+
disabled: PropTypes.bool,
|
68
|
+
}
|
69
|
+
|
70
|
+
Checkbox.defaultProps = {
|
71
|
+
getStyles: () => { },
|
72
|
+
onChange: () => { },
|
73
|
+
id: 'checkbox',
|
74
|
+
name: 'checkbox',
|
75
|
+
value: true,
|
76
|
+
label: 'Aceptas los terminos',
|
77
|
+
nameLinkCheck: '',
|
78
|
+
linkCheck: '',
|
79
|
+
handleClick: () => { },
|
80
|
+
disabled: false,
|
81
|
+
}
|
82
|
+
|
83
|
+
export default withStyles(styles)(Checkbox)
|
@@ -0,0 +1,60 @@
|
|
1
|
+
.checkbox {
|
2
|
+
display: flex;
|
3
|
+
}
|
4
|
+
|
5
|
+
/* ////////////////////// */
|
6
|
+
|
7
|
+
|
8
|
+
.checkbox-custom {
|
9
|
+
opacity: 0;
|
10
|
+
position: absolute;
|
11
|
+
}
|
12
|
+
|
13
|
+
.checkbox-custom,
|
14
|
+
.checkbox-custom-label {
|
15
|
+
display: inline-block;
|
16
|
+
vertical-align: middle;
|
17
|
+
margin: 5px;
|
18
|
+
cursor: pointer;
|
19
|
+
color: var(--color-brand-regent-gray);
|
20
|
+
font-weight: var(--font-weight-light);
|
21
|
+
}
|
22
|
+
|
23
|
+
.checkbox-custom+.checkbox-custom-label:before {
|
24
|
+
content: '';
|
25
|
+
background: #fff;
|
26
|
+
border-radius: 5px;
|
27
|
+
border: 2px solid #ddd;
|
28
|
+
display: inline-block;
|
29
|
+
vertical-align: middle;
|
30
|
+
width: 10px;
|
31
|
+
height: 10px;
|
32
|
+
padding: 2px;
|
33
|
+
margin-right: 10px;
|
34
|
+
text-align: center;
|
35
|
+
}
|
36
|
+
|
37
|
+
.checkbox-custom:checked+.checkbox-custom-label:before {
|
38
|
+
content: "";
|
39
|
+
display: inline-block;
|
40
|
+
width: 1px;
|
41
|
+
height: 5px;
|
42
|
+
border: solid var(--color-brand-smalt);
|
43
|
+
border-width: 0 3px 3px 0;
|
44
|
+
transform: rotate(45deg);
|
45
|
+
-webkit-transform: rotate(45deg);
|
46
|
+
-ms-transform: rotate(45deg);
|
47
|
+
border-radius: 0px;
|
48
|
+
margin: 0px 15px 5px 5px;
|
49
|
+
}
|
50
|
+
|
51
|
+
.checkbox-custom,
|
52
|
+
.checkbox-custom-link {
|
53
|
+
font-weight: var(--font-weight-normal);
|
54
|
+
color: var(--color-primary);
|
55
|
+
text-decoration: underline;
|
56
|
+
}
|
57
|
+
|
58
|
+
.is-disabled {
|
59
|
+
cursor: no-drop;
|
60
|
+
}
|
@@ -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/Divider/Divider.js
CHANGED
@@ -2,18 +2,21 @@ import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
3
3
|
|
4
4
|
import styles from './Divider.module.css'
|
5
|
+
import { options } from './constants'
|
5
6
|
import withStyles from '../../hocs/withStyles'
|
6
7
|
|
7
|
-
export const Divider = ({ getStyles }) => {
|
8
|
-
return <div className={getStyles('divider')} />
|
8
|
+
export const Divider = ({ color, getStyles }) => {
|
9
|
+
return <div className={getStyles('divider', ['color'])} />
|
9
10
|
}
|
10
11
|
|
11
12
|
Divider.propTypes = {
|
12
13
|
getStyles: PropTypes.func.isRequired,
|
14
|
+
color: PropTypes.oneOf(options.colors),
|
13
15
|
}
|
14
16
|
|
15
17
|
Divider.defaultProps = {
|
16
18
|
getStyles: () => {},
|
19
|
+
color: 'primary',
|
17
20
|
}
|
18
21
|
|
19
22
|
export default withStyles(styles)(Divider)
|
@@ -3,3 +3,23 @@
|
|
3
3
|
height: 1px;
|
4
4
|
background: var(--color-font-base);
|
5
5
|
}
|
6
|
+
|
7
|
+
.color-primary {
|
8
|
+
background: var(--color-primary);
|
9
|
+
}
|
10
|
+
|
11
|
+
.color-secondary {
|
12
|
+
background: var(--color-secondary);
|
13
|
+
}
|
14
|
+
|
15
|
+
.color-tertiary {
|
16
|
+
background: var(--color-tertiary);
|
17
|
+
}
|
18
|
+
|
19
|
+
.color-highlight {
|
20
|
+
background: var(--color-primary-highlight);
|
21
|
+
}
|
22
|
+
|
23
|
+
.color-inverted {
|
24
|
+
background: var(--color-primary-inverted);
|
25
|
+
}
|
@@ -1,12 +1,23 @@
|
|
1
|
-
import { Divider, styles } from '.'
|
1
|
+
import { Divider, styles, options } from '.'
|
2
2
|
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
getTemplate,
|
5
|
+
getListTemplate,
|
6
|
+
getOptionsArgTypes,
|
7
|
+
} from '../../helpers/storybook'
|
4
8
|
|
5
9
|
const Template = getTemplate(Divider, styles)
|
10
|
+
const ListTemplate = getListTemplate(Divider, styles)
|
6
11
|
|
7
12
|
export default {
|
8
13
|
title: 'Atoms/Divider',
|
9
14
|
component: Divider,
|
15
|
+
argTypes: {
|
16
|
+
color: getOptionsArgTypes(options.colors),
|
17
|
+
},
|
10
18
|
}
|
11
19
|
|
12
20
|
export const Default = Template.bind({})
|
21
|
+
|
22
|
+
export const Colors = ListTemplate.bind({})
|
23
|
+
Colors.args = { items: options.colors.map((color) => ({ color })) }
|