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/atoms/Input/Input.js
CHANGED
@@ -4,46 +4,226 @@ import PropTypes from 'prop-types'
|
|
4
4
|
import styles from './Input.module.css'
|
5
5
|
import { options } from './constants'
|
6
6
|
import withStyles from '../../hocs/withStyles'
|
7
|
+
import Icon from '../Icon'
|
8
|
+
import { Horizontal } from '../../layout/Spacer/components'
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
-
|
10
|
+
|
11
|
+
// const handleChange = ({ onChange }) => () => {
|
12
|
+
// onChange()
|
13
|
+
// }
|
11
14
|
|
12
15
|
export const Input = ({
|
13
16
|
getStyles,
|
14
17
|
type,
|
18
|
+
id,
|
15
19
|
value,
|
16
20
|
isInline,
|
21
|
+
isInlineCode,
|
22
|
+
isInputFilter,
|
23
|
+
isInputSecondary,
|
17
24
|
onChange,
|
25
|
+
onFocus,
|
26
|
+
onBlur,
|
27
|
+
onClick,
|
28
|
+
onKeyDown,
|
29
|
+
onKeyUp,
|
30
|
+
onInput,
|
31
|
+
maxLength,
|
18
32
|
placeholder,
|
33
|
+
autoComplete,
|
34
|
+
disabled,
|
35
|
+
isViewIcon,
|
36
|
+
idIcon,
|
37
|
+
nameIcon,
|
38
|
+
sizeIcon,
|
39
|
+
colorIcon,
|
40
|
+
backgroundIcon,
|
41
|
+
pattern,
|
42
|
+
onClickViewPass,
|
43
|
+
viewPass,
|
44
|
+
min,
|
45
|
+
autoFocus,
|
46
|
+
readonly,
|
19
47
|
}) => (
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
48
|
+
|
49
|
+
<>
|
50
|
+
|
51
|
+
{isViewIcon ?
|
52
|
+
|
53
|
+
<div className={getStyles('box-icon-input')}>
|
54
|
+
|
55
|
+
<Icon
|
56
|
+
id={idIcon}
|
57
|
+
name={nameIcon}
|
58
|
+
size={sizeIcon}
|
59
|
+
color={colorIcon}
|
60
|
+
background={backgroundIcon}
|
61
|
+
/>
|
62
|
+
|
63
|
+
<Horizontal size="xs" />
|
64
|
+
|
65
|
+
<input
|
66
|
+
className={getStyles('input', {
|
67
|
+
'is-inline': isInline,
|
68
|
+
'is-inline-code': isInlineCode,
|
69
|
+
'is-input-filter': isInputFilter,
|
70
|
+
'is-input-secondary': isInputSecondary,
|
71
|
+
})}
|
72
|
+
readOnly={readonly}
|
73
|
+
type={type}
|
74
|
+
id={id}
|
75
|
+
value={value}
|
76
|
+
placeholder={placeholder}
|
77
|
+
onChange={onChange}
|
78
|
+
onFocus={onFocus}
|
79
|
+
onBlur={onBlur}
|
80
|
+
onClick={onClick}
|
81
|
+
onKeyDown={onKeyDown}
|
82
|
+
onKeyUp={onKeyUp}
|
83
|
+
onInput={onInput}
|
84
|
+
autoComplete={autoComplete}
|
85
|
+
disabled={disabled}
|
86
|
+
min={min}
|
87
|
+
></input>
|
88
|
+
|
89
|
+
</div> :
|
90
|
+
|
91
|
+
type === 'password' ?
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<div className={getStyles('box-icon-input')}>
|
96
|
+
|
97
|
+
<input
|
98
|
+
className={getStyles('input', {
|
99
|
+
'is-inline': isInline,
|
100
|
+
'is-inline-code': isInlineCode,
|
101
|
+
'is-input-filter': isInputFilter,
|
102
|
+
'is-input-secondary': isInputSecondary,
|
103
|
+
})}
|
104
|
+
readOnly={readonly}
|
105
|
+
type={type}
|
106
|
+
id={id}
|
107
|
+
value={value}
|
108
|
+
placeholder={placeholder}
|
109
|
+
onChange={onChange}
|
110
|
+
onFocus={onFocus}
|
111
|
+
onBlur={onBlur}
|
112
|
+
onClick={onClick}
|
113
|
+
onKeyDown={onKeyDown}
|
114
|
+
autoComplete={autoComplete}
|
115
|
+
disabled={disabled}
|
116
|
+
min={min}
|
117
|
+
onInput={onInput}
|
118
|
+
></input>
|
119
|
+
|
120
|
+
<Horizontal size="xs" />
|
121
|
+
|
122
|
+
<Icon
|
123
|
+
background={!viewPass ? "inverted" : "success"}
|
124
|
+
color={!viewPass ? "base" : "inverted"}
|
125
|
+
isClickable
|
126
|
+
name="userView"
|
127
|
+
onClick={onClickViewPass}
|
128
|
+
size="sm"
|
129
|
+
/>
|
130
|
+
|
131
|
+
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
: <input
|
137
|
+
className={getStyles('input', {
|
138
|
+
'is-inline': isInline,
|
139
|
+
'is-inline-code': isInlineCode,
|
140
|
+
'is-input-filter': isInputFilter,
|
141
|
+
'is-input-secondary': isInputSecondary,
|
142
|
+
})}
|
143
|
+
readOnly={readonly}
|
144
|
+
type={type}
|
145
|
+
id={id}
|
146
|
+
value={value}
|
147
|
+
placeholder={placeholder}
|
148
|
+
onChange={onChange}
|
149
|
+
onFocus={onFocus}
|
150
|
+
onBlur={onBlur}
|
151
|
+
onClick={onClick}
|
152
|
+
onKeyDown={onKeyDown}
|
153
|
+
maxLength={maxLength}
|
154
|
+
autoComplete={autoComplete}
|
155
|
+
disabled={disabled}
|
156
|
+
min={min}
|
157
|
+
autoFocus={autoFocus}
|
158
|
+
onInput={onInput}
|
159
|
+
></input>
|
160
|
+
|
161
|
+
}
|
162
|
+
|
163
|
+
</>
|
29
164
|
)
|
30
165
|
|
31
166
|
Input.propTypes = {
|
32
167
|
onChange: PropTypes.func.isRequired,
|
168
|
+
onFocus: PropTypes.func,
|
169
|
+
onBlur: PropTypes.func,
|
170
|
+
onClick: PropTypes.func,
|
171
|
+
onKeyDown: PropTypes.func,
|
172
|
+
onKeyUp: PropTypes.func,
|
173
|
+
onInput: PropTypes.func,
|
174
|
+
maxLength: PropTypes.number,
|
33
175
|
getStyles: PropTypes.func.isRequired,
|
34
176
|
type: PropTypes.oneOf(options.types),
|
177
|
+
id: PropTypes.string.isRequired,
|
35
178
|
value: PropTypes.string,
|
36
179
|
placeholder: PropTypes.string,
|
37
180
|
isInline: PropTypes.bool,
|
181
|
+
isInlineCode: PropTypes.bool,
|
182
|
+
isInputFilter: PropTypes.bool,
|
183
|
+
isInputSecondary: PropTypes.bool,
|
184
|
+
isViewIcon: PropTypes.bool,
|
185
|
+
idIcon: PropTypes.string,
|
186
|
+
nameIcon: PropTypes.string,
|
187
|
+
sizeIcon: PropTypes.string,
|
188
|
+
colorIcon: PropTypes.string,
|
189
|
+
backgroundIcon: PropTypes.string,
|
190
|
+
autoComplete: PropTypes.string,
|
191
|
+
disabled: PropTypes.bool,
|
192
|
+
readonly: PropTypes.bool,
|
193
|
+
min: PropTypes.any,
|
194
|
+
autoFocus: PropTypes.any,
|
195
|
+
onClickViewPass: PropTypes.func,
|
196
|
+
viewPass: PropTypes.bool,
|
38
197
|
}
|
39
198
|
|
40
199
|
Input.defaultProps = {
|
41
200
|
type: 'text',
|
42
|
-
value: '',
|
201
|
+
// value: '',
|
202
|
+
id: '',
|
43
203
|
placeholder: '',
|
44
204
|
isInline: false,
|
45
|
-
|
46
|
-
|
205
|
+
isInlineCode: false,
|
206
|
+
isInputFilter: false,
|
207
|
+
isInputSecondary: false,
|
208
|
+
onChange: () => { },
|
209
|
+
onFocus: () => { },
|
210
|
+
onBlur: () => { },
|
211
|
+
onClick: () => { },
|
212
|
+
onKeyDown: () => { },
|
213
|
+
onKeyUp: () => { },
|
214
|
+
onInput: () => { },
|
215
|
+
getStyles: () => { },
|
216
|
+
isViewIcon: false,
|
217
|
+
idIcon: 'Ejemplo',
|
218
|
+
nameIcon: 'user',
|
219
|
+
sizeIcon: 'md',
|
220
|
+
colorIcon: 'highlight',
|
221
|
+
backgroundIcon: 'base',
|
222
|
+
autoComplete: 'on',
|
223
|
+
disabled: false,
|
224
|
+
readonly: false,
|
225
|
+
onClickViewPass: () => { },
|
226
|
+
viewPass: false,
|
47
227
|
}
|
48
228
|
|
49
229
|
export default withStyles(styles)(Input)
|
@@ -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 {
|
@@ -22,6 +23,61 @@
|
|
22
23
|
outline: none;
|
23
24
|
}
|
24
25
|
|
26
|
+
.input:disabled::placeholder {
|
27
|
+
color: #9a9a9a;
|
28
|
+
font-weight: var(--font-weight-light);
|
29
|
+
}
|
30
|
+
|
31
|
+
.input:disabled {
|
32
|
+
background: #dedede;
|
33
|
+
}
|
34
|
+
|
35
|
+
[data-theme="GrupoMutua"] .input {
|
36
|
+
border-radius: var(--button-border-radius-sm);
|
37
|
+
}
|
38
|
+
|
39
|
+
[data-theme="Taxisvalencia"] .input,
|
40
|
+
[data-theme="Radiotaxiaragon"] .input,
|
41
|
+
[data-theme="Spartan"] .input,
|
42
|
+
[data-theme="Default"] .input {
|
43
|
+
border-radius: var(--button-border-radius-sm);
|
44
|
+
}
|
45
|
+
|
46
|
+
|
25
47
|
.is-inline {
|
26
48
|
max-width: max-content;
|
27
49
|
}
|
50
|
+
|
51
|
+
.is-inline-code {
|
52
|
+
max-width: 38px;
|
53
|
+
padding: 7px 9px;
|
54
|
+
margin-right: 8px;
|
55
|
+
font-size: var(--font-size-md);
|
56
|
+
font-weight: var(--font-weight-bold);
|
57
|
+
text-align: center;
|
58
|
+
}
|
59
|
+
|
60
|
+
.is-input-filter {
|
61
|
+
border-radius: var(--border-radius-sm);
|
62
|
+
color: var(--color-font-highlight);
|
63
|
+
padding: 7px 9px;
|
64
|
+
font-size: var(--font-size-base);
|
65
|
+
font-weight: var(--font-weight-light);
|
66
|
+
text-align: left;
|
67
|
+
height: 28px;
|
68
|
+
}
|
69
|
+
|
70
|
+
.is-input-secondary {
|
71
|
+
border-radius: var(--border-radius-sm);
|
72
|
+
color: var(--color-font-base);
|
73
|
+
padding: 7px 9px;
|
74
|
+
font-size: var(--font-size-base);
|
75
|
+
font-weight: var(--font-weight-light);
|
76
|
+
text-align: left;
|
77
|
+
height: 28px;
|
78
|
+
}
|
79
|
+
|
80
|
+
.box-icon-input {
|
81
|
+
display: flex;
|
82
|
+
align-items: center;
|
83
|
+
}
|
@@ -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 = { isInputFilter: 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.oneOfType([PropTypes.string, PropTypes.object]),
|
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: ' ',
|
27
|
+
isHint: false,
|
28
|
+
color: 'label',
|
29
|
+
}
|
30
|
+
|
31
|
+
export default withStyles(styles)(Label)
|
@@ -0,0 +1,42 @@
|
|
1
|
+
.label {
|
2
|
+
display: flex;
|
3
|
+
text-align: left;
|
4
|
+
width: 100%;
|
5
|
+
/* color: var(--color-brand-eastern-blue); */
|
6
|
+
font-family: var(--font-family-sans);
|
7
|
+
font-size: var(--font-size-mini);
|
8
|
+
font-weight: var(--font-weight-light);
|
9
|
+
line-height: var(--line-height-tight);
|
10
|
+
}
|
11
|
+
|
12
|
+
.is-hint {
|
13
|
+
font-size: 11px;
|
14
|
+
}
|
15
|
+
|
16
|
+
.color-label {
|
17
|
+
color: var(--color-brand-eastern-blue);
|
18
|
+
}
|
19
|
+
|
20
|
+
.color-base {
|
21
|
+
color: var(--color-font-base);
|
22
|
+
}
|
23
|
+
|
24
|
+
.color-inverted {
|
25
|
+
color: var(--color-font-inverted);
|
26
|
+
}
|
27
|
+
|
28
|
+
.color-muted {
|
29
|
+
color: var(--color-brand-mandy);
|
30
|
+
}
|
31
|
+
|
32
|
+
.color-primary {
|
33
|
+
color: var(--color-primary);
|
34
|
+
}
|
35
|
+
|
36
|
+
.color-tertiary {
|
37
|
+
color: var(--color-tertiary);
|
38
|
+
}
|
39
|
+
|
40
|
+
.color-info {
|
41
|
+
color: var(--color-brand-azure-radiance);
|
42
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { Label, styles, options } from '.'
|
2
|
+
|
3
|
+
import {
|
4
|
+
getTemplate,
|
5
|
+
getListTemplate,
|
6
|
+
getOptionsArgTypes,
|
7
|
+
} from '../../helpers/storybook'
|
8
|
+
|
9
|
+
const Template = getTemplate(Label, styles)
|
10
|
+
const ListTemplate = getListTemplate(Label, styles)
|
11
|
+
|
12
|
+
export default {
|
13
|
+
title: 'Atoms/Label',
|
14
|
+
component: Label,
|
15
|
+
args: {
|
16
|
+
isHint: false
|
17
|
+
},
|
18
|
+
argTypes: {
|
19
|
+
color: getOptionsArgTypes(options.colors),
|
20
|
+
},
|
21
|
+
}
|
22
|
+
|
23
|
+
export const Default = Template.bind({})
|
24
|
+
|
25
|
+
export const Colors = ListTemplate.bind({})
|
26
|
+
Colors.args = { items: options.colors.map((color) => ({ color })) }
|
@@ -0,0 +1 @@
|
|
1
|
+
export const options = { colors: ['label', 'base', 'muted', 'inverted', 'primary', 'tertiary', 'info'], }
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
import Link from 'next/link'
|
4
|
+
|
5
|
+
import styles from './LinkItem.module.css'
|
6
|
+
import { options } from './constants'
|
7
|
+
import withStyles from '../../hocs/withStyles'
|
8
|
+
// import Paragraph from '../Paragraph'
|
9
|
+
|
10
|
+
export const LinkItem = ({ children, size, color, getStyles, isHref, target }) => {
|
11
|
+
return (
|
12
|
+
<Link href={isHref} passHref>
|
13
|
+
<a target={target} className={getStyles('link', ['color'])}>
|
14
|
+
{/* <Paragraph size={size} color={color} weight="semibold" isInline> */}
|
15
|
+
{children}
|
16
|
+
{/* </Paragraph> */}
|
17
|
+
</a>
|
18
|
+
</Link>
|
19
|
+
)
|
20
|
+
}
|
21
|
+
|
22
|
+
LinkItem.propTypes = {
|
23
|
+
children: PropTypes.node.isRequired,
|
24
|
+
getStyles: PropTypes.func.isRequired,
|
25
|
+
color: PropTypes.oneOf(options.colors),
|
26
|
+
size: PropTypes.oneOf(options.sizes),
|
27
|
+
target: PropTypes.string,
|
28
|
+
}
|
29
|
+
|
30
|
+
LinkItem.defaultProps = {
|
31
|
+
getStyles: () => { },
|
32
|
+
color: 'primary',
|
33
|
+
size: 'md',
|
34
|
+
isHref: '/',
|
35
|
+
target: ''
|
36
|
+
}
|
37
|
+
|
38
|
+
export default withStyles(styles)(LinkItem)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.link {
|
2
2
|
display: inline;
|
3
3
|
max-width: max-content;
|
4
|
-
border-bottom: 1px solid currentColor;
|
4
|
+
/* border-bottom: 1px solid currentColor; */
|
5
5
|
cursor: pointer;
|
6
6
|
}
|
7
7
|
|
@@ -12,3 +12,8 @@
|
|
12
12
|
.color-tertiary {
|
13
13
|
color: var(--color-tertiary);
|
14
14
|
}
|
15
|
+
|
16
|
+
.link p {
|
17
|
+
font-weight: var(--font-weight-normal);
|
18
|
+
text-decoration: underline;
|
19
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { LinkItem, styles, options } from '.'
|
2
2
|
|
3
3
|
import {
|
4
4
|
getTemplate,
|
@@ -6,12 +6,12 @@ import {
|
|
6
6
|
getOptionsArgTypes,
|
7
7
|
} from '../../helpers/storybook'
|
8
8
|
|
9
|
-
const Template = getTemplate(
|
10
|
-
const ListTemplate = getListTemplate(
|
9
|
+
const Template = getTemplate(LinkItem, styles)
|
10
|
+
const ListTemplate = getListTemplate(LinkItem, styles)
|
11
11
|
|
12
12
|
export default {
|
13
|
-
title: 'Atoms/
|
14
|
-
component:
|
13
|
+
title: 'Atoms/LinkItem',
|
14
|
+
component: LinkItem,
|
15
15
|
args: {
|
16
16
|
children: 'Mouths Muil',
|
17
17
|
},
|
package/atoms/Modal/Modal.js
CHANGED
@@ -8,7 +8,9 @@ import Icon from '../Icon'
|
|
8
8
|
import Container from '../../layout/Container'
|
9
9
|
import isEmpty from '../../utils/isEmpty'
|
10
10
|
|
11
|
+
|
11
12
|
import useMedia from '../../hook/useMedia'
|
13
|
+
import Heading from '../Heading'
|
12
14
|
|
13
15
|
// Sync with ./Modal.module.css#L13-L17
|
14
16
|
const FADE_OUT_ANIMATION_TIME = 400
|
@@ -33,6 +35,9 @@ export const Modal = ({
|
|
33
35
|
getStyles,
|
34
36
|
type,
|
35
37
|
isPlayground,
|
38
|
+
titleModal,
|
39
|
+
isFullWidth,
|
40
|
+
isFullWidthSoft,
|
36
41
|
}) => {
|
37
42
|
const isDesktop = useMedia(['(min-width: 992px)'], [true])
|
38
43
|
const [onFadeOut, setOnFadeOut] = useState(false)
|
@@ -48,13 +53,14 @@ export const Modal = ({
|
|
48
53
|
onClick={handleClose}
|
49
54
|
>
|
50
55
|
<div
|
51
|
-
className={getStyles('modal', ['type'])}
|
56
|
+
className={getStyles(isFullWidth ? 'modal-full' : isFullWidthSoft ? 'modal-full-soft' : 'modal', ['type'])}
|
52
57
|
onClick={createHandlerClick()}
|
53
58
|
>
|
54
59
|
<div className={getStyles('heading')}>
|
55
60
|
{!!onClose && (
|
56
61
|
<Icon
|
57
|
-
|
62
|
+
id='btnColsedModal'
|
63
|
+
color={isDesktop && type === 'secondary' ? 'primary' : 'primary'}
|
58
64
|
name={isDesktop ? 'cross' : 'angleLeft'}
|
59
65
|
background={isDesktop ? 'transparent' : 'muted'}
|
60
66
|
onClick={handleClose}
|
@@ -71,8 +77,19 @@ export const Modal = ({
|
|
71
77
|
})}
|
72
78
|
/>
|
73
79
|
)}
|
80
|
+
<Heading color='black' size='lg' weight='light'>
|
81
|
+
{titleModal}
|
82
|
+
</Heading>
|
74
83
|
</div>
|
75
|
-
|
84
|
+
|
85
|
+
{isFullWidth ?
|
86
|
+
<div className={getStyles('container-full')}>{children}</div>
|
87
|
+
:
|
88
|
+
isFullWidthSoft ? <div className={getStyles('container-full-soft')}>{children}</div>
|
89
|
+
:
|
90
|
+
<Container><div className={getStyles('container')}>{children}</div></Container>
|
91
|
+
}
|
92
|
+
|
76
93
|
</div>
|
77
94
|
</div>
|
78
95
|
)
|
@@ -88,11 +105,17 @@ Modal.propTypes = {
|
|
88
105
|
}),
|
89
106
|
type: PropTypes.oneOf(options.types),
|
90
107
|
isPlayground: PropTypes.bool,
|
108
|
+
isFullWidth: PropTypes.bool,
|
109
|
+
isFullWidthSoft: PropTypes.bool,
|
110
|
+
titleModal: PropTypes.string,
|
91
111
|
}
|
92
112
|
|
93
113
|
Modal.defaultProps = {
|
94
|
-
getStyles: () => {},
|
114
|
+
getStyles: () => { },
|
95
115
|
type: 'primary',
|
116
|
+
titleModal: 'Ejemplo titulo',
|
117
|
+
isFullWidth: false,
|
118
|
+
isFullWidthSoft: false
|
96
119
|
}
|
97
120
|
|
98
121
|
export default withStyles(styles)(Modal)
|