imbric-theme 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. package/.dockerignore +14 -0
  2. package/.eslintignore +1 -0
  3. package/.prettierignore +1 -0
  4. package/.storybook/main.js +6 -2
  5. package/.storybook/preview.js +21 -0
  6. package/.vscode/settings.json +3 -0
  7. package/Dockerfile +17 -0
  8. package/atoms/AlertModal/AlertModal.js +69 -0
  9. package/atoms/AlertModal/AlertModal.module.css +3 -0
  10. package/atoms/AlertModal/AlertModal.stories.js +30 -0
  11. package/atoms/AlertModal/constants.js +4 -0
  12. package/atoms/AlertModal/index.js +3 -0
  13. package/atoms/Button/Button.js +17 -2
  14. package/atoms/Button/Button.module.css +25 -3
  15. package/atoms/Button/Button.stories.js +1 -1
  16. package/atoms/Button/__snapshots__/Button.stories.js.snap +8 -8
  17. package/atoms/Check/Check.js +6 -4
  18. package/atoms/Checkbox/Checkbox.js +77 -0
  19. package/atoms/Checkbox/Checkbox.module.css +60 -0
  20. package/atoms/Checkbox/Checkbox.stories.js +30 -0
  21. package/atoms/Checkbox/constants.js +1 -0
  22. package/atoms/Checkbox/index.js +3 -0
  23. package/atoms/Divider/Divider.js +5 -2
  24. package/atoms/Divider/Divider.module.css +20 -0
  25. package/atoms/Divider/Divider.stories.js +13 -2
  26. package/atoms/Divider/constants.js +3 -0
  27. package/atoms/Divider/index.js +1 -0
  28. package/atoms/Heading/Heading.js +1 -1
  29. package/atoms/Heading/Heading.module.css +4 -0
  30. package/atoms/Heading/Heading.stories.js +2 -2
  31. package/atoms/Heading/__snapshots__/Heading.stories.js.snap +16 -16
  32. package/atoms/Heading/constants.js +1 -1
  33. package/atoms/Icon/Icon.js +1 -1
  34. package/atoms/Icon/Icon.module.css +30 -0
  35. package/atoms/Icon/constants.js +750 -145
  36. package/atoms/Input/Input.js +195 -15
  37. package/atoms/Input/Input.module.css +62 -6
  38. package/atoms/Input/Input.stories.js +8 -2
  39. package/atoms/Input/__snapshots__/Input.stories.js.snap +5 -5
  40. package/atoms/Input/constants.js +1 -1
  41. package/atoms/Label/Label.js +31 -0
  42. package/atoms/Label/Label.module.css +42 -0
  43. package/atoms/Label/Label.stories.js +26 -0
  44. package/atoms/Label/constants.js +1 -0
  45. package/atoms/Label/index.js +3 -0
  46. package/atoms/LinkItem/LinkItem.js +38 -0
  47. package/atoms/{Link/Link.module.css → LinkItem/LinkItem.module.css} +6 -1
  48. package/atoms/{Link/Link.stories.js → LinkItem/LinkItem.stories.js} +5 -5
  49. package/atoms/LinkItem/index.js +3 -0
  50. package/atoms/Modal/Modal.js +27 -4
  51. package/atoms/Modal/Modal.module.css +63 -6
  52. package/atoms/Paragraph/Paragraph.module.css +4 -0
  53. package/atoms/Paragraph/Paragraph.stories.js +2 -2
  54. package/atoms/Paragraph/__snapshots__/Paragraph.stories.js.snap +16 -16
  55. package/atoms/Picture/Picture.js +9 -2
  56. package/atoms/Tab/Tab.js +41 -0
  57. package/atoms/Tab/Tab.module.css +17 -0
  58. package/atoms/Tab/Tab.stories.js +27 -0
  59. package/atoms/Tab/constants.js +1 -0
  60. package/atoms/Tab/index.js +3 -0
  61. package/atoms/Textarea/Textarea.js +106 -15
  62. package/atoms/Textarea/Textarea.module.css +31 -2
  63. package/atoms/Toggle/Toggle.js +56 -0
  64. package/atoms/Toggle/Toggle.module.css +41 -0
  65. package/atoms/Toggle/Toggle.stories.js +21 -0
  66. package/atoms/Toggle/constants.js +1 -0
  67. package/atoms/Toggle/index.js +3 -0
  68. package/helpers/storybook.js +2 -2
  69. package/hook/useAddColumn.js +40 -0
  70. package/hook/useStateDate.js +25 -0
  71. package/hook/useTable.js +54 -0
  72. package/index.js +41 -1
  73. package/jest.config.js +1 -1
  74. package/layout/DynamicTable/DynamicTable.js +372 -0
  75. package/layout/DynamicTable/DynamicTable.module.css +62 -0
  76. package/layout/DynamicTable/DynamicTable.stories.js +79 -0
  77. package/layout/DynamicTable/constants.js +323 -0
  78. package/layout/DynamicTable/index.js +3 -0
  79. package/layout/FlexColumnContent/FlexColumnContent.js +26 -0
  80. package/layout/FlexColumnContent/FlexColumnContent.module.css +5 -0
  81. package/layout/FlexColumnContent/FlexColumnContent.stories.js +28 -0
  82. package/layout/FlexColumnContent/constants.js +1 -0
  83. package/layout/FlexColumnContent/index.js +3 -0
  84. package/layout/Navbar/Navbar.js +247 -0
  85. package/layout/Navbar/Navbar.module.css +35 -0
  86. package/layout/Navbar/Navbar.stories.js +20 -0
  87. package/layout/Navbar/constants.js +35 -0
  88. package/layout/Navbar/index.js +2 -0
  89. package/layout/Sidebar/Sidebar.js +115 -0
  90. package/layout/Sidebar/Sidebar.module.css +387 -0
  91. package/layout/Sidebar/Sidebar.stories.js +28 -0
  92. package/layout/Sidebar/constants.js +228 -0
  93. package/layout/Sidebar/index.js +3 -0
  94. package/molecules/Accordion/Accordion.js +11 -11
  95. package/molecules/CardDefault/CardDefault.js +65 -0
  96. package/molecules/CardDefault/CardDefault.module.css +19 -0
  97. package/molecules/CardDefault/CardDefault.stories.js +23 -0
  98. package/molecules/CardDefault/constants.js +1 -0
  99. package/molecules/CardDefault/index.js +3 -0
  100. package/molecules/CardProductTypesBooking/CardProductTypesBooking.js +89 -0
  101. package/molecules/CardProductTypesBooking/CardProductTypesBooking.module.css +118 -0
  102. package/molecules/CardProductTypesBooking/CardProductTypesBooking.stories.js +25 -0
  103. package/molecules/CardProductTypesBooking/constants.js +1 -0
  104. package/molecules/CardProductTypesBooking/index.js +3 -0
  105. package/molecules/CardServiceDetail/CardServiceDetail.js +400 -0
  106. package/molecules/CardServiceDetail/CardServiceDetail.module.css +222 -0
  107. package/molecules/CardServiceDetail/CardServiceDetail.stories.js +23 -0
  108. package/molecules/CardServiceDetail/constants.js +1 -0
  109. package/molecules/CardServiceDetail/index.js +3 -0
  110. package/molecules/CardServices/CardServices.js +461 -0
  111. package/molecules/CardServices/CardServices.module.css +213 -0
  112. package/molecules/CardServices/CardServices.stories.js +41 -0
  113. package/molecules/CardServices/constants.js +5 -0
  114. package/molecules/CardServices/index.js +3 -0
  115. package/molecules/CardServicesFinalized/CardServicesFinalized.js +381 -0
  116. package/molecules/CardServicesFinalized/CardServicesFinalized.module.css +213 -0
  117. package/molecules/CardServicesFinalized/CardServicesFinalized.stories.js +23 -0
  118. package/molecules/CardServicesFinalized/constants.js +1 -0
  119. package/molecules/CardServicesFinalized/index.js +3 -0
  120. package/molecules/CheckList/CheckList.js +135 -0
  121. package/molecules/CheckList/CheckList.module.css +94 -0
  122. package/molecules/CheckList/CheckList.stories.js +25 -0
  123. package/molecules/CheckList/constants.js +23 -0
  124. package/molecules/CheckList/index.js +3 -0
  125. package/molecules/ColumnTable/ColumnTable.js +155 -0
  126. package/molecules/ColumnTable/ColumnTable.module.css +51 -0
  127. package/molecules/ColumnTable/ColumnTable.stories.js +26 -0
  128. package/molecules/ColumnTable/constants.js +117 -0
  129. package/molecules/ColumnTable/index.js +3 -0
  130. package/molecules/DatePicker/DatePicker.js +242 -0
  131. package/molecules/DatePicker/DatePicker.module.css +38 -0
  132. package/molecules/DatePicker/DatePicker.stories.js +23 -0
  133. package/molecules/DatePicker/constants.js +3 -0
  134. package/molecules/DatePicker/index.js +3 -0
  135. package/molecules/DatePickerTime/DatePickerTime.js +133 -0
  136. package/molecules/DatePickerTime/DatePickerTime.module.css +3 -0
  137. package/molecules/DatePickerTime/DatePickerTime.stories.js +18 -0
  138. package/molecules/DatePickerTime/constants.js +1 -0
  139. package/molecules/DatePickerTime/index.js +3 -0
  140. package/molecules/Dropdown/Dropdown.js +26 -23
  141. package/molecules/Dropdown/Dropdown.module.css +21 -3
  142. package/molecules/DynamicSelect/DynamicSelect.js +186 -0
  143. package/molecules/DynamicSelect/DynamicSelect.module.css +10 -0
  144. package/molecules/DynamicSelect/DynamicSelect.stories.js +32 -0
  145. package/molecules/DynamicSelect/constants.js +7 -0
  146. package/molecules/DynamicSelect/index.js +3 -0
  147. package/molecules/Error/Error.js +2 -2
  148. package/molecules/Error/Error.module.css +3 -2
  149. package/molecules/FooterTable/FooterTable.js +166 -0
  150. package/molecules/FooterTable/FooterTable.module.css +63 -0
  151. package/molecules/FooterTable/FooterTable.stories.js +23 -0
  152. package/molecules/FooterTable/constants.js +9 -0
  153. package/molecules/FooterTable/index.js +3 -0
  154. package/molecules/InputAutocomplete/InputAutocomplete.js +221 -0
  155. package/molecules/InputAutocomplete/InputAutocomplete.module.css +55 -0
  156. package/molecules/InputAutocomplete/InputAutocomplete.stories.js +23 -0
  157. package/molecules/InputAutocomplete/constants.js +1 -0
  158. package/molecules/InputAutocomplete/index.js +3 -0
  159. package/molecules/ItemMenu/ItemMenu.js +134 -0
  160. package/molecules/ItemMenu/ItemMenu.module.css +363 -0
  161. package/molecules/ItemMenu/ItemMenu.stories.js +42 -0
  162. package/molecules/ItemMenu/constants.js +36 -0
  163. package/molecules/ItemMenu/index.js +3 -0
  164. package/molecules/RowTable/RowTable.js +928 -0
  165. package/molecules/RowTable/RowTable.module.css +63 -0
  166. package/molecules/RowTable/RowTable.stories.js +26 -0
  167. package/molecules/RowTable/constants.js +798 -0
  168. package/molecules/RowTable/index.js +3 -0
  169. package/molecules/Tabs/Tabs.js +59 -0
  170. package/molecules/Tabs/Tabs.module.css +13 -0
  171. package/molecules/Tabs/Tabs.stories.js +34 -0
  172. package/molecules/Tabs/constants.js +34 -0
  173. package/molecules/Tabs/index.js +3 -0
  174. package/package.json +33 -16
  175. package/pages/Login/Login.js +102 -0
  176. package/pages/Login/Login.module.css +5 -0
  177. package/pages/Login/Login.stories.js +23 -0
  178. package/pages/Login/constants.js +1 -0
  179. package/pages/Login/index.js +3 -0
  180. package/pages/Login/validation/loginSchema.js +5 -0
  181. package/public/favicon.ico +0 -0
  182. package/public/static/google-maps.png +0 -0
  183. package/public/static/images/folders-folder.svg +26 -0
  184. package/public/static/images/permissions.svg +14 -0
  185. package/public/static/images/reports-results.svg +18 -0
  186. package/public/static/logo.svg +19 -0
  187. package/public/static/logologin.png +0 -0
  188. package/public/static/logologin.svg +16 -0
  189. package/public/static/logologintagos.svg +19 -0
  190. package/public/static/logotipo.svg +50 -0
  191. package/public/static/logotipoS.svg +26 -0
  192. package/public/static/taxisvalencia_logod.png +0 -0
  193. package/scripts/create-component.js +2 -1
  194. package/styles/GrupoMutua.css +391 -0
  195. package/styles/default.css +391 -0
  196. package/styles/globals.css +1514 -0
  197. package/styles/radiotaxiaragon.css +391 -0
  198. package/styles/spartan.css +391 -0
  199. package/styles/tagos.css +391 -0
  200. package/styles/taxisvalencia.css +391 -0
  201. package/styles/tokens.css +2 -1
  202. package/tokens/index.js +2 -1
  203. package/.eslintcache +0 -1
  204. package/atoms/Link/Link.js +0 -33
  205. package/atoms/Link/index.js +0 -3
  206. /package/atoms/{Link → LinkItem}/__snapshots__/Link.stories.js.snap +0 -0
  207. /package/atoms/{Link → LinkItem}/constants.js +0 -0
@@ -0,0 +1,242 @@
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
+ import useStateDate from '../../hook/useStateDate';
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
+
36
+ export const DatePicker = ({ getStyles, isLayoutDate, onChangeRange, sinceDateRange, tillDateRange }) => {
37
+
38
+ const [isShowCalendar, setShowCalendar] = useState(false);
39
+
40
+
41
+ const { state, setState } = useStateDate();
42
+
43
+
44
+ // const [state, setState] = useState([
45
+ // {
46
+ // startDate: addDays(new Date(), -59),
47
+ // endDate: new Date(),
48
+ // key: 'selection',
49
+ // }
50
+
51
+ // ]);
52
+
53
+ moment.locale('es')
54
+ const format = "DD/MMMM/YYYY";
55
+
56
+
57
+ const handleSelectRange = (item) => {
58
+ setState([item.selection])
59
+ }
60
+
61
+ const handleSelect = (date) => {
62
+ console.log(date); // native Date object
63
+ console.log(state)
64
+ }
65
+
66
+ const handleClickOpenCalendar = () => {
67
+ setShowCalendar(true)
68
+ // console.log(state)
69
+ }
70
+
71
+ const handleClickCloseCalendar = () => {
72
+ setShowCalendar(false)
73
+ console.log(state)
74
+ };
75
+
76
+
77
+ return (
78
+ <div className={getStyles('date-picker')}>
79
+
80
+ {isLayoutDate === 'Calendar' ?
81
+
82
+ (<Calendar
83
+ date={new Date()}
84
+ onChange={handleSelect}
85
+ color={'#3d91ff'}
86
+ />)
87
+ : isLayoutDate === 'DateRange' ?
88
+
89
+ (<DateRange
90
+ editableDateInputs={true}
91
+ onChange={item => useStateDate([item.selection])}
92
+ moveRangeOnFirstSelection={false}
93
+ ranges={state}
94
+ />)
95
+ :
96
+
97
+ !isShowCalendar ?
98
+ <div className={getStyles('date-picker-input')}>
99
+ <div>
100
+ <Label>{sinceDateRange}</Label>
101
+ <Input
102
+ isInline
103
+ id="startDate"
104
+ onClick={handleClickOpenCalendar}
105
+ placeholder="Et harum quidem"
106
+ value={moment(state[0].startDate).format(format).toString()}
107
+ />
108
+ <Vertical size="xs" />
109
+ </div>
110
+
111
+ <div>
112
+ <Label>{tillDateRange}</Label>
113
+ <Input
114
+ isInline
115
+ id="endDate"
116
+ onClick={handleClickOpenCalendar}
117
+ placeholder="Et harum quidem"
118
+ value={moment(state[0].endDate).format(format).toString()}
119
+ />
120
+ </div>
121
+ </div>
122
+ :
123
+ <div className={getStyles('modalDatePickerRange')}>
124
+
125
+ <DateRangePicker
126
+ locale={locales.es}
127
+ dateDisplayFormat='d MMMM yyyy'
128
+ onChange={item => { handleSelectRange(item); onChangeRange(item); }}
129
+ showSelectionPreview={false}
130
+ moveRangeOnFirstSelection={false}
131
+ months={2}
132
+ ranges={state}
133
+ direction="horizontal"
134
+ inputRanges={[
135
+ {
136
+ ...defaultInputRanges[0],
137
+ label: 'Dias hasta hoy'
138
+ },
139
+ {
140
+ ...defaultInputRanges[1],
141
+ label: 'Dias desde hoy'
142
+ }
143
+ ]}
144
+ staticRanges={[
145
+ // ...defaultStaticRanges,
146
+ {
147
+ label: "Mes pasado",
148
+ range: () => ({
149
+ startDate: startOfMonth(addMonths(new Date(), -1)),
150
+ endDate: endOfMonth(addMonths(new Date(), -1))
151
+ }),
152
+ isSelected(range) {
153
+ const definedRange = this.range();
154
+ return (
155
+ isSameDay(range.startDate, definedRange.startDate) &&
156
+ isSameDay(range.endDate, definedRange.endDate)
157
+ );
158
+ }
159
+ },
160
+ {
161
+ label: "Mes actual",
162
+ range: () => ({
163
+ startDate: startOfMonth(new Date()),
164
+ endDate: endOfDay(new Date())
165
+ }),
166
+ isSelected(range) {
167
+ const definedRange = this.range();
168
+ return (
169
+ isSameDay(range.startDate, definedRange.startDate) &&
170
+ isSameDay(range.endDate, definedRange.endDate)
171
+ );
172
+ }
173
+ },
174
+ {
175
+ label: "Año pasado",
176
+ range: () => ({
177
+ startDate: startOfYear(addYears(new Date(), -1)),
178
+ endDate: endOfYear(addYears(new Date(), -1))
179
+ }),
180
+ isSelected(range) {
181
+ const definedRange = this.range();
182
+ return (
183
+ isSameDay(range.startDate, definedRange.startDate) &&
184
+ isSameDay(range.endDate, definedRange.endDate)
185
+ );
186
+ }
187
+ },
188
+ {
189
+ label: "Año actual",
190
+ range: () => ({
191
+ startDate: startOfYear(new Date()),
192
+ endDate: endOfDay(new Date())
193
+ }),
194
+ isSelected(range) {
195
+ const definedRange = this.range();
196
+ return (
197
+ isSameDay(range.startDate, definedRange.startDate) &&
198
+ isSameDay(range.endDate, definedRange.endDate)
199
+ );
200
+ }
201
+ }
202
+ ]}
203
+ />
204
+
205
+ <div className={getStyles('btnSave')} onClick={handleClickCloseCalendar}>
206
+ <Icon
207
+ id='iconClosedDatePicker'
208
+ name="checkCircle"
209
+ color="inverted"
210
+ onClick={function noRefCheck() { }}
211
+ />
212
+ </div>
213
+
214
+ {/* <DefinedRange
215
+ locale={locales.es}
216
+ onChange={item => useStateDate([item.selection])}
217
+ ranges={state}
218
+ /> */}
219
+ </div>
220
+
221
+ }
222
+ </div>
223
+ )
224
+ }
225
+
226
+ DatePicker.propTypes = {
227
+ getStyles: PropTypes.func.isRequired,
228
+ isLayoutDate: PropTypes.oneOf(options.typeLayoutDate),
229
+ onChangeRange: PropTypes.func,
230
+ sinceDateRange: PropTypes.string,
231
+ tillDateRange: PropTypes.string,
232
+ }
233
+
234
+ DatePicker.defaultProps = {
235
+ getStyles: () => { },
236
+ isLayoutDate: 'Calendar',
237
+ onChangeRange: () => { },
238
+ sinceDateRange: 'Desde',
239
+ tillDateRange: 'Hasta',
240
+ }
241
+
242
+ 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 })) }
@@ -0,0 +1,3 @@
1
+ export const options = {
2
+ typeLayoutDate: ['Calendar', 'DateRange', 'DateRangePicker']
3
+ }
@@ -0,0 +1,3 @@
1
+ export { default, DatePicker } from './DatePicker'
2
+ export { options } from './constants'
3
+ export { default as styles } from './DatePicker.module.css'
@@ -0,0 +1,133 @@
1
+ import React, { useState } from 'react'
2
+ import PropTypes from 'prop-types'
3
+
4
+ import styles from './DatePickerTime.module.css'
5
+ import { options } from './constants'
6
+ import withStyles from '../../hocs/withStyles'
7
+ import DatePicker, { CalendarContainer } from 'react-datepicker'
8
+ // import "react-datepicker/dist/react-datepicker.css"
9
+
10
+ import { registerLocale, setDefaultLocale } from "react-datepicker";
11
+ import es from 'date-fns/locale/es'
12
+ import moment from 'moment'
13
+ import Input from '../../atoms/Input/Input'
14
+
15
+
16
+ export const DatePickerTime = ({
17
+ getStyles,
18
+ showIcon,
19
+ selected,
20
+ onChange,
21
+ timeCaption,
22
+ minDate,
23
+ showTimeSelect,
24
+ filterTime,
25
+ dateFormat,
26
+ timeIntervals,
27
+ idPicker,
28
+ }) => {
29
+
30
+ registerLocale('es', es)
31
+ setDefaultLocale('es')
32
+
33
+ // const now = moment().add(15, 'minutes').format('d MMMM yyyy, HH:mm')
34
+
35
+ // const now = new Date()
36
+
37
+ // const nowSelected = new Date()
38
+ // nowSelected.setMinutes(nowSelected.getMinutes() + 15)
39
+
40
+ // const [startDate, setStartDate] = useState(nowSelected)
41
+
42
+ // const filterPassedTime = (time) => {
43
+ // const currentDate = new Date()
44
+ // currentDate.setMinutes(currentDate.getMinutes() + 15)
45
+ // const selectedDate = new Date(time)
46
+ // return currentDate.getTime() < selectedDate.getTime()
47
+ // }
48
+
49
+
50
+ // const MyContainer = ({ className, children }) => {
51
+ // return (
52
+ // // <div style={{ padding: "0px", background: "#216ba5", color: "#fff" }}>
53
+ // <CalendarContainer className={className}>
54
+ // {/* <div style={{ background: "#f0f0f0" }}>
55
+ // ¿Fecha de taxi?
56
+ // </div> */}
57
+ // <div style={{
58
+ // fontFamily: 'Exo, Arial, sans-serif',
59
+ // fontSize: '13px',
60
+ // fontWeight: '300'
61
+ // }}>{children}</div>
62
+ // </CalendarContainer >
63
+ // // </div>
64
+ // )
65
+ // }
66
+
67
+ return (
68
+
69
+ <div className={getStyles('date-picker-time')}>
70
+ <DatePicker
71
+ showIcon={showIcon}
72
+ selected={selected}
73
+ onChange={onChange}
74
+ timeCaption={timeCaption}
75
+ // locale="es"
76
+ // showTimeSelect
77
+ // timeFormat="p"
78
+ // timeIntervals={15}
79
+ // dateFormat="Pp"<
80
+ minDate={minDate}
81
+ showTimeSelect={showTimeSelect}
82
+ filterTime={filterTime}
83
+ dateFormat={dateFormat}
84
+ timeIntervals={timeIntervals}
85
+ id={idPicker}
86
+ customInput={<Input isInputSecondary> </Input>}
87
+ // calendarContainer={MyContainer}
88
+
89
+ // minTime={(new Date(), 0)}
90
+ // maxTime={(new Date(), 30)}
91
+ // maxTime={setHours(setMinutes(new Date(), 30), 20)}
92
+ // includeTimes={[
93
+ // setHours(setMinutes(new Date(), 0), 17),
94
+ // setHours(setMinutes(new Date(), 30), 18),
95
+ // setHours(setMinutes(new Date(), 30), 19),
96
+ // setHours(setMinutes(new Date(), 30), 17),
97
+ // ]}
98
+ // dateFormat="d MMMM yyyy, HH:mm aa"
99
+ />
100
+ </div>
101
+ )
102
+
103
+ }
104
+
105
+ DatePickerTime.propTypes = {
106
+ getStyles: PropTypes.func.isRequired,
107
+ showIcon: PropTypes.bool,
108
+ selected: PropTypes.any,
109
+ onChange: PropTypes.func,
110
+ timeCaption: PropTypes.string,
111
+ minDate: PropTypes.any,
112
+ showTimeSelect: PropTypes.bool,
113
+ filterTime: PropTypes.any,
114
+ dateFormat: PropTypes.string,
115
+ timeIntervals: PropTypes.any,
116
+ idPicker: PropTypes.string,
117
+ }
118
+
119
+ DatePickerTime.defaultProps = {
120
+ getStyles: () => { },
121
+ showIcon: true,
122
+ // selected: { startDate },
123
+ onChange: () => { },
124
+ timeCaption: "Hora",
125
+ // minDate: { now },
126
+ showTimeSelect: true,
127
+ // filterTime: { filterPassedTime },
128
+ dateFormat: "dd-MM-yyyy HH:mm aa",
129
+ timeIntervals: 1,
130
+ idPicker: 'hola'
131
+ }
132
+
133
+ export default withStyles(styles)(DatePickerTime)
@@ -0,0 +1,3 @@
1
+ .date-picker-time {
2
+ display: flex;
3
+ }
@@ -0,0 +1,18 @@
1
+ import { DatePickerTime, styles, options } from '.'
2
+
3
+ import {
4
+ getTemplate,
5
+ getListTemplate,
6
+ getOptionsArgTypes,
7
+ } from '../../helpers/storybook'
8
+
9
+ const Template = getTemplate(DatePickerTime, styles)
10
+ const ListTemplate = getListTemplate(DatePickerTime, styles)
11
+
12
+ export default {
13
+ title: 'Molecules/DatePickerTime',
14
+ component: DatePickerTime,
15
+ args: {},
16
+ }
17
+
18
+ export const Default = Template.bind({})
@@ -0,0 +1 @@
1
+ export const options = { types: [] }
@@ -0,0 +1,3 @@
1
+ export { default, DatePickerTime } from './DatePickerTime'
2
+ export { options } from './constants'
3
+ export { default as styles } from './DatePickerTime.module.css'
@@ -13,27 +13,30 @@ export const Dropdown = ({
13
13
  value,
14
14
  isInline,
15
15
  onChange,
16
- }) => (
17
- <div
18
- id={id}
19
- className={getStyles('dropdown', {
20
- 'is-inline': isInline,
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
+ className={getStyles('dropdown', {
20
+ 'is-inline': isInline,
21
+ })}
28
22
  >
29
- {options.map(({ text, value }) => (
30
- <option key={value} value={value}>
31
- {text}
32
- </option>
33
- ))}
34
- </select>
35
- </div>
36
- )
23
+ <Icon className="dropdown-icon" name="angleDown" background="transparent" />
24
+ <select
25
+ id={id}
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,
@@ -44,7 +47,7 @@ Dropdown.propTypes = {
44
47
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
45
48
  })
46
49
  ).isRequired,
47
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
50
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.any]),
48
51
  id: PropTypes.string,
49
52
  isInline: PropTypes.bool,
50
53
  }
@@ -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: 10px 30px 10px 20px;
20
- border: var(--border-width-thin) solid var(--color-primary);
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;