imbric-theme 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- package/.storybook/main.js +1 -1
- package/atoms/AlertModal/AlertModal.js +77 -0
- package/atoms/AlertModal/AlertModal.module.css +3 -0
- package/atoms/AlertModal/AlertModal.stories.js +30 -0
- package/atoms/AlertModal/constants.js +4 -0
- package/atoms/AlertModal/index.js +3 -0
- package/atoms/Button/Button.js +5 -2
- package/atoms/Button/Button.module.css +6 -3
- package/atoms/Checkbox/Checkbox.js +49 -0
- package/atoms/Checkbox/Checkbox.module.css +3 -0
- package/atoms/Checkbox/Checkbox.stories.js +28 -0
- package/atoms/Checkbox/constants.js +1 -0
- package/atoms/Checkbox/index.js +3 -0
- package/atoms/Heading/Heading.js +1 -1
- package/atoms/Heading/Heading.module.css +4 -0
- package/atoms/Heading/constants.js +1 -1
- package/atoms/Icon/constants.js +30 -6
- package/atoms/Icon/file-download-svgrepo-com.svg +13 -0
- package/atoms/Input/Input.js +21 -5
- package/atoms/Input/Input.module.css +26 -6
- package/atoms/Input/Input.stories.js +8 -2
- package/atoms/Input/__snapshots__/Input.stories.js.snap +5 -5
- package/atoms/Input/constants.js +1 -1
- package/atoms/Label/Label.js +31 -0
- package/atoms/Label/Label.module.css +38 -0
- package/atoms/Label/Label.stories.js +26 -0
- package/atoms/Label/constants.js +1 -0
- package/atoms/Label/index.js +3 -0
- package/atoms/Paragraph/Paragraph.module.css +4 -0
- package/index.js +20 -1
- package/jest.config.js +1 -1
- package/layout/DynamicTable/DynamicTable.js +207 -0
- package/layout/DynamicTable/DynamicTable.module.css +62 -0
- package/layout/DynamicTable/DynamicTable.stories.js +30 -0
- package/layout/DynamicTable/constants.js +840 -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 +123 -0
- package/molecules/ColumnTable/ColumnTable.module.css +9 -0
- package/molecules/ColumnTable/ColumnTable.stories.js +29 -0
- package/molecules/ColumnTable/constants.js +1 -0
- package/molecules/ColumnTable/index.js +3 -0
- package/molecules/DatePicker/DatePicker.js +223 -0
- package/molecules/DatePicker/DatePicker.module.css +38 -0
- package/molecules/DatePicker/DatePicker.stories.js +23 -0
- package/molecules/DatePicker/constants.js +3 -0
- package/molecules/DatePicker/index.js +3 -0
- package/molecules/Dropdown/Dropdown.js +25 -22
- package/molecules/Dropdown/Dropdown.module.css +21 -3
- package/molecules/DynamicSelect/DynamicSelect.js +109 -0
- package/molecules/DynamicSelect/DynamicSelect.module.css +10 -0
- package/molecules/DynamicSelect/DynamicSelect.stories.js +32 -0
- package/molecules/DynamicSelect/constants.js +7 -0
- package/molecules/DynamicSelect/index.js +3 -0
- package/molecules/Error/Error.js +2 -2
- package/molecules/Error/Error.module.css +3 -2
- package/molecules/RowTable/RowTable.js +22 -0
- package/molecules/RowTable/RowTable.module.css +3 -0
- package/molecules/RowTable/RowTable.stories.js +23 -0
- package/molecules/RowTable/constants.js +1 -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
@@ -0,0 +1,223 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
import { useState } from 'react';
|
4
|
+
import styles from './DatePicker.module.css'
|
5
|
+
import { options } from './constants'
|
6
|
+
import withStyles from '../../hocs/withStyles'
|
7
|
+
import { Calendar, DateRangePicker, DateRange, DefinedRange, defaultStaticRanges, defaultInputRanges } from 'react-date-range';
|
8
|
+
import Input from '../../atoms/Input';
|
9
|
+
import * as locales from 'react-date-range/dist/locale';
|
10
|
+
import moment from 'moment'
|
11
|
+
import Label from '../../atoms/Label';
|
12
|
+
import { Horizontal, Vertical } from '../../layout/Spacer/components'
|
13
|
+
import Icon from '../../atoms/Icon';
|
14
|
+
|
15
|
+
// import 'react-date-range/dist/styles.css'; // main css file
|
16
|
+
// import 'react-date-range/dist/theme/default.css'; // theme css file
|
17
|
+
|
18
|
+
import {
|
19
|
+
addDays,
|
20
|
+
endOfDay,
|
21
|
+
startOfDay,
|
22
|
+
startOfYear,
|
23
|
+
startOfMonth,
|
24
|
+
endOfMonth,
|
25
|
+
endOfYear,
|
26
|
+
addMonths,
|
27
|
+
addYears,
|
28
|
+
startOfWeek,
|
29
|
+
endOfWeek,
|
30
|
+
isSameDay,
|
31
|
+
differenceInCalendarDays
|
32
|
+
} from "date-fns";
|
33
|
+
|
34
|
+
|
35
|
+
export const DatePicker = ({ getStyles, isLayoutDate }) => {
|
36
|
+
|
37
|
+
const [isShowCalendar, setShowCalendar] = useState(false);
|
38
|
+
|
39
|
+
const [state, setState] = useState([
|
40
|
+
{
|
41
|
+
startDate: addDays(new Date(), -59),
|
42
|
+
endDate: new Date(),
|
43
|
+
key: 'selection',
|
44
|
+
}
|
45
|
+
|
46
|
+
]);
|
47
|
+
|
48
|
+
moment.locale('es')
|
49
|
+
const format = "DD/MMMM/YYYY";
|
50
|
+
|
51
|
+
const handleSelect = (date) => {
|
52
|
+
console.log(date); // native Date object
|
53
|
+
console.log(state)
|
54
|
+
console.log(date)
|
55
|
+
}
|
56
|
+
|
57
|
+
const handleClickOpenCalendar = () => {
|
58
|
+
setShowCalendar(true)
|
59
|
+
}
|
60
|
+
|
61
|
+
const handleClickCloseCalendar = () => {
|
62
|
+
setShowCalendar(false)
|
63
|
+
};
|
64
|
+
|
65
|
+
|
66
|
+
return (
|
67
|
+
<div className={getStyles('date-picker')}>
|
68
|
+
|
69
|
+
{isLayoutDate === 'Calendar' ?
|
70
|
+
|
71
|
+
(<Calendar
|
72
|
+
date={new Date()}
|
73
|
+
onChange={handleSelect}
|
74
|
+
/>)
|
75
|
+
: isLayoutDate === 'DateRange' ?
|
76
|
+
|
77
|
+
(<DateRange
|
78
|
+
editableDateInputs={true}
|
79
|
+
onChange={item => setState([item.selection])}
|
80
|
+
moveRangeOnFirstSelection={false}
|
81
|
+
ranges={state}
|
82
|
+
/>)
|
83
|
+
:
|
84
|
+
|
85
|
+
!isShowCalendar ?
|
86
|
+
<div className={getStyles('date-picker-input')}>
|
87
|
+
<div>
|
88
|
+
<Label>Desde</Label>
|
89
|
+
<Input
|
90
|
+
isInline
|
91
|
+
id="startDate"
|
92
|
+
onClick={handleClickOpenCalendar}
|
93
|
+
placeholder="Et harum quidem"
|
94
|
+
value={moment(state[0].startDate).format(format).toString()}
|
95
|
+
/>
|
96
|
+
<Vertical size="xs" />
|
97
|
+
</div>
|
98
|
+
|
99
|
+
<div>
|
100
|
+
<Label>Hasta</Label>
|
101
|
+
<Input
|
102
|
+
isInline
|
103
|
+
id="endDate"
|
104
|
+
onClick={handleClickOpenCalendar}
|
105
|
+
placeholder="Et harum quidem"
|
106
|
+
value={moment(state[0].endDate).format(format).toString()}
|
107
|
+
/>
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
:
|
111
|
+
<div className={getStyles('modalDatePickerRange')}>
|
112
|
+
|
113
|
+
<DateRangePicker
|
114
|
+
locale={locales.es}
|
115
|
+
dateDisplayFormat='d MMMM yyyy'
|
116
|
+
onChange={item => setState([item.selection])}
|
117
|
+
showSelectionPreview={false}
|
118
|
+
moveRangeOnFirstSelection={false}
|
119
|
+
months={2}
|
120
|
+
ranges={state}
|
121
|
+
direction="horizontal"
|
122
|
+
inputRanges={[
|
123
|
+
{
|
124
|
+
...defaultInputRanges[0],
|
125
|
+
label: 'Dias hasta hoy'
|
126
|
+
},
|
127
|
+
{
|
128
|
+
...defaultInputRanges[1],
|
129
|
+
label: 'Dias desde hoy'
|
130
|
+
}
|
131
|
+
]}
|
132
|
+
staticRanges={[
|
133
|
+
// ...defaultStaticRanges,
|
134
|
+
{
|
135
|
+
label: "Mes pasado",
|
136
|
+
range: () => ({
|
137
|
+
startDate: startOfMonth(addMonths(new Date(), -1)),
|
138
|
+
endDate: endOfMonth(addMonths(new Date(), -1))
|
139
|
+
}),
|
140
|
+
isSelected(range) {
|
141
|
+
const definedRange = this.range();
|
142
|
+
return (
|
143
|
+
isSameDay(range.startDate, definedRange.startDate) &&
|
144
|
+
isSameDay(range.endDate, definedRange.endDate)
|
145
|
+
);
|
146
|
+
}
|
147
|
+
},
|
148
|
+
{
|
149
|
+
label: "Mes actual",
|
150
|
+
range: () => ({
|
151
|
+
startDate: startOfMonth(new Date()),
|
152
|
+
endDate: endOfDay(new Date())
|
153
|
+
}),
|
154
|
+
isSelected(range) {
|
155
|
+
const definedRange = this.range();
|
156
|
+
return (
|
157
|
+
isSameDay(range.startDate, definedRange.startDate) &&
|
158
|
+
isSameDay(range.endDate, definedRange.endDate)
|
159
|
+
);
|
160
|
+
}
|
161
|
+
},
|
162
|
+
{
|
163
|
+
label: "Año pasado",
|
164
|
+
range: () => ({
|
165
|
+
startDate: startOfYear(addYears(new Date(), -1)),
|
166
|
+
endDate: endOfYear(addYears(new Date(), -1))
|
167
|
+
}),
|
168
|
+
isSelected(range) {
|
169
|
+
const definedRange = this.range();
|
170
|
+
return (
|
171
|
+
isSameDay(range.startDate, definedRange.startDate) &&
|
172
|
+
isSameDay(range.endDate, definedRange.endDate)
|
173
|
+
);
|
174
|
+
}
|
175
|
+
},
|
176
|
+
{
|
177
|
+
label: "Año actual",
|
178
|
+
range: () => ({
|
179
|
+
startDate: startOfYear(new Date()),
|
180
|
+
endDate: endOfDay(new Date())
|
181
|
+
}),
|
182
|
+
isSelected(range) {
|
183
|
+
const definedRange = this.range();
|
184
|
+
return (
|
185
|
+
isSameDay(range.startDate, definedRange.startDate) &&
|
186
|
+
isSameDay(range.endDate, definedRange.endDate)
|
187
|
+
);
|
188
|
+
}
|
189
|
+
}
|
190
|
+
]}
|
191
|
+
/>
|
192
|
+
|
193
|
+
<div className={getStyles('btnSave')} onClick={handleClickCloseCalendar}>
|
194
|
+
<Icon
|
195
|
+
name="checkCircle"
|
196
|
+
color="inverted"
|
197
|
+
onClick={function noRefCheck() { }}
|
198
|
+
/>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
{/* <DefinedRange
|
202
|
+
locale={locales.es}
|
203
|
+
onChange={item => setState([item.selection])}
|
204
|
+
ranges={state}
|
205
|
+
/> */}
|
206
|
+
</div>
|
207
|
+
|
208
|
+
}
|
209
|
+
</div>
|
210
|
+
)
|
211
|
+
}
|
212
|
+
|
213
|
+
DatePicker.propTypes = {
|
214
|
+
getStyles: PropTypes.func.isRequired,
|
215
|
+
isLayoutDate: PropTypes.oneOf(options.typeLayoutDate),
|
216
|
+
}
|
217
|
+
|
218
|
+
DatePicker.defaultProps = {
|
219
|
+
getStyles: () => { },
|
220
|
+
isLayoutDate: 'Calendar'
|
221
|
+
}
|
222
|
+
|
223
|
+
export default withStyles(styles)(DatePicker)
|
@@ -0,0 +1,38 @@
|
|
1
|
+
.date-picker {
|
2
|
+
display: block;
|
3
|
+
}
|
4
|
+
|
5
|
+
.date-picker-input {
|
6
|
+
display: flex;
|
7
|
+
width: 70%;
|
8
|
+
}
|
9
|
+
|
10
|
+
.modalDatePickerRange {
|
11
|
+
display: flex;
|
12
|
+
position: absolute;
|
13
|
+
align-items: center;
|
14
|
+
justify-content: center;
|
15
|
+
width: 100%;
|
16
|
+
height: 100%;
|
17
|
+
top: 0;
|
18
|
+
left: 0;
|
19
|
+
background-color: rgb(0 0 0 / 60%);
|
20
|
+
z-index: 1;
|
21
|
+
}
|
22
|
+
|
23
|
+
.btnSave {
|
24
|
+
cursor: pointer;
|
25
|
+
width: 30px;
|
26
|
+
background-color: var(--color-tertiary-muted);
|
27
|
+
height: 420px;
|
28
|
+
align-items: center;
|
29
|
+
justify-content: center;
|
30
|
+
display: inline-flex;
|
31
|
+
height: inherit;
|
32
|
+
max-height: 383px;
|
33
|
+
height: 100%;
|
34
|
+
}
|
35
|
+
|
36
|
+
.btnSave:hover {
|
37
|
+
opacity: .8;
|
38
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { DatePicker, styles, options } from '.'
|
2
|
+
|
3
|
+
import {
|
4
|
+
getTemplate,
|
5
|
+
getListTemplate,
|
6
|
+
getOptionsArgTypes,
|
7
|
+
} from '../../helpers/storybook'
|
8
|
+
|
9
|
+
const Template = getTemplate(DatePicker, styles)
|
10
|
+
const ListTemplate = getListTemplate(DatePicker, styles)
|
11
|
+
|
12
|
+
export default {
|
13
|
+
title: 'Molecules/DatePicker',
|
14
|
+
component: DatePicker,
|
15
|
+
args: {},
|
16
|
+
argTypes: {
|
17
|
+
isLayoutDate: getOptionsArgTypes(options.typeLayoutDate),
|
18
|
+
},
|
19
|
+
}
|
20
|
+
|
21
|
+
export const Default = Template.bind({})
|
22
|
+
// export const List = ListTemplate.bind({})
|
23
|
+
// List.args = { items: options.types.map((type) => ({ type })) }
|
@@ -13,27 +13,30 @@ export const Dropdown = ({
|
|
13
13
|
value,
|
14
14
|
isInline,
|
15
15
|
onChange,
|
16
|
-
}) =>
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
'
|
21
|
-
|
22
|
-
|
23
|
-
<Icon className="dropdown-icon" name="angleDown" background="highlight" />
|
24
|
-
<select
|
25
|
-
className={getStyles('dropdown-select')}
|
26
|
-
onChange={(event) => onChange(event?.currentTarget?.value)}
|
27
|
-
value={value}
|
16
|
+
}) => {
|
17
|
+
return (
|
18
|
+
<div
|
19
|
+
id={id}
|
20
|
+
className={getStyles('dropdown', {
|
21
|
+
'is-inline': isInline,
|
22
|
+
})}
|
28
23
|
>
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
24
|
+
<Icon className="dropdown-icon" name="angleDown" background="transparent" />
|
25
|
+
<select
|
26
|
+
className={getStyles('dropdown-select')}
|
27
|
+
onChange={(event) => onChange(event?.currentTarget?.value)}
|
28
|
+
value={value}
|
29
|
+
>
|
30
|
+
{options.map(({ text, value }) => (
|
31
|
+
<option key={value} value={value}>
|
32
|
+
{text}
|
33
|
+
</option>
|
34
|
+
))}
|
35
|
+
</select>
|
36
|
+
|
37
|
+
</div>
|
38
|
+
)
|
39
|
+
}
|
37
40
|
|
38
41
|
Dropdown.propTypes = {
|
39
42
|
onChange: PropTypes.func.isRequired,
|
@@ -52,8 +55,8 @@ Dropdown.propTypes = {
|
|
52
55
|
Dropdown.defaultProps = {
|
53
56
|
value: '',
|
54
57
|
isInline: false,
|
55
|
-
onChange: () => {},
|
56
|
-
getStyles: () => {},
|
58
|
+
onChange: () => { },
|
59
|
+
getStyles: () => { },
|
57
60
|
}
|
58
61
|
|
59
62
|
export default withStyles(styles)(Dropdown)
|
@@ -16,14 +16,32 @@
|
|
16
16
|
.dropdown-select {
|
17
17
|
width: 100%;
|
18
18
|
height: var(--input-height);
|
19
|
-
padding:
|
20
|
-
border: var(--border-width-thin) solid var(--color-
|
19
|
+
padding: 8px 30px 8px 20px;
|
20
|
+
border: var(--border-width-thin) solid var(--color-brand-white-lilac);
|
21
21
|
background: var(--input-background);
|
22
|
-
border-radius: var(--input-border-radius);
|
22
|
+
/* border-radius: var(--input-border-radius); */
|
23
23
|
color: var(--color-font-base);
|
24
|
+
font-family: var(--font-family-sans);
|
25
|
+
font-size: var(--input-font-base);
|
26
|
+
font-weight: var(--font-weight-medium);
|
27
|
+
line-height: var(--line-height-relaxed);
|
24
28
|
transition: box-shadow 0.2s ease;
|
29
|
+
-moz-appearance: none; /* Firefox */
|
30
|
+
-webkit-appearance: none; /* Safari and Chrome */
|
31
|
+
appearance: none;
|
25
32
|
}
|
26
33
|
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
/* padding: 12px 17px; */
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
27
45
|
.dropdown-select:focus {
|
28
46
|
box-shadow: 0 0 0 1px var(--color-primary), 0 0 10px 0 var(--color-primary);
|
29
47
|
outline: none;
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Select from 'react-select'
|
3
|
+
import PropTypes from 'prop-types'
|
4
|
+
import styles from './DynamicSelect.module.css'
|
5
|
+
import withStyles from '../../hocs/withStyles'
|
6
|
+
|
7
|
+
|
8
|
+
export const DynamicSelect = ({ getStyles, optionsSelect, defaultValue, placeholder, isMulti, isClearable, isDisabled, isLoading, isRtl, isSearchable, isInline, onChange }) => {
|
9
|
+
|
10
|
+
|
11
|
+
const customStyles = {
|
12
|
+
|
13
|
+
option: (base, state) => ({
|
14
|
+
...base,
|
15
|
+
cursor: 'pointer',
|
16
|
+
height: '100%',
|
17
|
+
backgroundColor: state.isSelected ? 'var(--color-primary)' : 'transparent',
|
18
|
+
"&:hover": {
|
19
|
+
backgroundColor: "var(--color-primary-highlight)",
|
20
|
+
color: 'var(--color-primary)',
|
21
|
+
},
|
22
|
+
// "&:active": {
|
23
|
+
// backgroundColor: "var(--color-primary)"
|
24
|
+
// }
|
25
|
+
}),
|
26
|
+
control: (base, state) => ({
|
27
|
+
...base,
|
28
|
+
cursor: 'pointer',
|
29
|
+
width: '100%',
|
30
|
+
borderRadius: 0,
|
31
|
+
border: 'var(--border-width-thin) solid var(--color-brand-white-lilac)',
|
32
|
+
// border: state.isFocused ? "var(--border-width-thin) solid var(--color-brand-white-lilac)" : "var(--border-width-thin) solid var(--color-brand-white-lilac)",
|
33
|
+
boxShadow: state.isFocused ? "0 0 0 1px var(--color-primary), 0 0 10px 0 var(--color-primary)" : "none",
|
34
|
+
"&:hover": {
|
35
|
+
borderColor: "var(--color-primary)"
|
36
|
+
}
|
37
|
+
}),
|
38
|
+
input: (base) => ({
|
39
|
+
...base,
|
40
|
+
cursor: 'pointer',
|
41
|
+
margin: '2px',
|
42
|
+
paddingBottom: '2px',
|
43
|
+
paddingTop: '2px',
|
44
|
+
}),
|
45
|
+
|
46
|
+
}
|
47
|
+
|
48
|
+
// const handleChange = (value) => {
|
49
|
+
// console.group('Value Changed');
|
50
|
+
// console.log(value);
|
51
|
+
// // console.log(`action: ${actionMeta.action}`);
|
52
|
+
// console.groupEnd();
|
53
|
+
// };
|
54
|
+
|
55
|
+
return (
|
56
|
+
|
57
|
+
<div className={getStyles('dynamic-select', {
|
58
|
+
'is-inline': isInline,
|
59
|
+
})}>
|
60
|
+
<Select
|
61
|
+
name="basic"
|
62
|
+
// className="basic-single"
|
63
|
+
// classNamePrefix="select"
|
64
|
+
placeholder={placeholder}
|
65
|
+
styles={customStyles}
|
66
|
+
options={optionsSelect}
|
67
|
+
defaultValue={defaultValue}
|
68
|
+
isMulti={isMulti}
|
69
|
+
isClearable={isClearable}
|
70
|
+
isDisabled={isDisabled}
|
71
|
+
isLoading={isLoading}
|
72
|
+
isRtl={isRtl}
|
73
|
+
isSearchable={isSearchable}
|
74
|
+
onChange={onChange}
|
75
|
+
/>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
)
|
79
|
+
}
|
80
|
+
|
81
|
+
DynamicSelect.propTypes = {
|
82
|
+
getStyles: PropTypes.func.isRequired,
|
83
|
+
defaultValue: PropTypes.string,
|
84
|
+
placeholder: PropTypes.string,
|
85
|
+
isMulti: PropTypes.bool,
|
86
|
+
isClearable: PropTypes.bool,
|
87
|
+
isDisabled: PropTypes.bool,
|
88
|
+
isLoading: PropTypes.bool,
|
89
|
+
isRtl: PropTypes.bool,
|
90
|
+
isSearchable: PropTypes.bool,
|
91
|
+
isInline: PropTypes.bool,
|
92
|
+
onChange: PropTypes.func
|
93
|
+
}
|
94
|
+
|
95
|
+
DynamicSelect.defaultProps = {
|
96
|
+
getStyles: () => { },
|
97
|
+
defaultValue: '',
|
98
|
+
placeholder: 'seleccionar',
|
99
|
+
isMulti: false,
|
100
|
+
isClearable: true,
|
101
|
+
isDisabled: false,
|
102
|
+
isLoading: false,
|
103
|
+
isRtl: false,
|
104
|
+
isSearchable: false,
|
105
|
+
isInline: false,
|
106
|
+
onChange: () => { },
|
107
|
+
}
|
108
|
+
|
109
|
+
export default withStyles(styles)(DynamicSelect)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { DynamicSelect, styles, options } from '.'
|
2
|
+
|
3
|
+
import {
|
4
|
+
getTemplate,
|
5
|
+
getListTemplate,
|
6
|
+
getOptionsArgTypes,
|
7
|
+
} from '../../helpers/storybook'
|
8
|
+
|
9
|
+
const Template = getTemplate(DynamicSelect, styles)
|
10
|
+
const ListTemplate = getListTemplate(DynamicSelect, styles)
|
11
|
+
|
12
|
+
export default {
|
13
|
+
title: 'Molecules/DynamicSelect',
|
14
|
+
component: DynamicSelect,
|
15
|
+
args: {
|
16
|
+
optionsSelect: options.optionsSelect,
|
17
|
+
defaultValue: '',
|
18
|
+
placeholder: 'seleccionar',
|
19
|
+
isMulti: false,
|
20
|
+
isClearable: true,
|
21
|
+
isDisabled: false,
|
22
|
+
isLoading: false,
|
23
|
+
isRtl: false,
|
24
|
+
isSearchable: false,
|
25
|
+
isInline: false,
|
26
|
+
},
|
27
|
+
argTypes: {
|
28
|
+
// types: getOptionsArgTypes(options.types),
|
29
|
+
},
|
30
|
+
}
|
31
|
+
|
32
|
+
export const Default = Template.bind({})
|
package/molecules/Error/Error.js
CHANGED
@@ -12,11 +12,11 @@ import Icon from '../../atoms/Icon'
|
|
12
12
|
export const Error = ({ title, children, getStyles }) => {
|
13
13
|
return (
|
14
14
|
<div className={getStyles('error')}>
|
15
|
-
<Icon className="icon-warning" name="warning" size="
|
15
|
+
<Icon className="icon-warning" name="warning" size="lg" />
|
16
16
|
<Spacer.Horizontal size="sm" />
|
17
17
|
<div>
|
18
18
|
{title && <Heading>{title}</Heading>}
|
19
|
-
<Paragraph>{children}</Paragraph>
|
19
|
+
<Paragraph size="sm">{children}</Paragraph>
|
20
20
|
</div>
|
21
21
|
</div>
|
22
22
|
)
|
@@ -1,9 +1,10 @@
|
|
1
1
|
.error {
|
2
2
|
display: flex;
|
3
3
|
padding: 10px 20px;
|
4
|
-
border-top:
|
5
|
-
background: var(--color-red-
|
4
|
+
border-top: 2px solid var(--color-red-500);
|
5
|
+
background: var(--color-red-100);
|
6
6
|
color: var(--color-red-800);
|
7
|
+
border-radius: var(--border-radius-sm);
|
7
8
|
}
|
8
9
|
|
9
10
|
.error :global(.icon-warning) {
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import PropTypes from 'prop-types'
|
3
|
+
|
4
|
+
import styles from './RowTable.module.css'
|
5
|
+
import { options } from './constants'
|
6
|
+
import withStyles from '../../hocs/withStyles'
|
7
|
+
|
8
|
+
export const RowTable = ({ children, getStyles }) => {
|
9
|
+
return <div className={getStyles('row-table')}>{children}</div>
|
10
|
+
}
|
11
|
+
|
12
|
+
RowTable.propTypes = {
|
13
|
+
children: PropTypes.node.isRequired,
|
14
|
+
getStyles: PropTypes.func.isRequired,
|
15
|
+
type: PropTypes.oneOf(options.types),
|
16
|
+
}
|
17
|
+
|
18
|
+
RowTable.defaultProps = {
|
19
|
+
getStyles: () => {},
|
20
|
+
}
|
21
|
+
|
22
|
+
export default withStyles(styles)(RowTable)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { RowTable, styles, options } from '.'
|
2
|
+
|
3
|
+
import {
|
4
|
+
getTemplate,
|
5
|
+
getListTemplate,
|
6
|
+
getOptionsArgTypes,
|
7
|
+
} from '../../helpers/storybook'
|
8
|
+
|
9
|
+
const Template = getTemplate(RowTable, styles)
|
10
|
+
const ListTemplate = getListTemplate(RowTable, styles)
|
11
|
+
|
12
|
+
export default {
|
13
|
+
title: 'Molecules/RowTable',
|
14
|
+
component: RowTable,
|
15
|
+
args: {},
|
16
|
+
argTypes: {
|
17
|
+
types: getOptionsArgTypes(options.types),
|
18
|
+
},
|
19
|
+
}
|
20
|
+
|
21
|
+
export const Default = Template.bind({})
|
22
|
+
export const List = ListTemplate.bind({})
|
23
|
+
List.args = { items: options.types.map((type) => ({ type })) }
|
@@ -0,0 +1 @@
|
|
1
|
+
export const options = { types: [] }
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "imbric-theme",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.4",
|
4
4
|
"description": "Components library IMBRIC",
|
5
5
|
"private": false,
|
6
6
|
"main": "index.js",
|
@@ -52,9 +52,16 @@
|
|
52
52
|
"dependencies": {
|
53
53
|
"classnames": "2.3.1",
|
54
54
|
"formik": "2.2.9",
|
55
|
+
"moment": "2.29.3",
|
56
|
+
"moment-timezone": "0.5.34",
|
57
|
+
"react-date-range": "1.4.0",
|
55
58
|
"react-icons": "4.3.1",
|
59
|
+
"react-moment": "1.1.2",
|
56
60
|
"react-router": "6.3.0",
|
57
61
|
"react-router-dom": "6.3.0",
|
62
|
+
"react-select": "5.3.2",
|
63
|
+
"sweetalert2": "11.4.14",
|
64
|
+
"sweetalert2-react-content": "5.0.0",
|
58
65
|
"yup": "0.32.11"
|
59
66
|
},
|
60
67
|
"devDependencies": {
|