@quillsql/react 1.1.8 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/BarList.d.ts +1 -0
- package/lib/BarList.js +129 -37
- package/lib/BarList.js.map +1 -1
- package/lib/Chart.d.ts +3 -3
- package/lib/Chart.js +66 -30
- package/lib/Chart.js.map +1 -1
- package/lib/Context.d.ts +1 -1
- package/lib/Dashboard.d.ts +1 -1
- package/lib/Dashboard.js +0 -4
- package/lib/Dashboard.js.map +1 -1
- package/lib/DateRangePicker/Calendar.d.ts +1 -1
- package/lib/DateRangePicker/Calendar.js +122 -23
- package/lib/DateRangePicker/Calendar.js.map +1 -1
- package/lib/DateRangePicker/DateRangePicker.js +5 -6
- package/lib/DateRangePicker/DateRangePicker.js.map +1 -1
- package/lib/DateRangePicker/DateRangePickerButton.d.ts +1 -1
- package/lib/DateRangePicker/DateRangePickerButton.js +101 -17
- package/lib/DateRangePicker/DateRangePickerButton.js.map +1 -1
- package/lib/DateRangePicker/dateRangePickerUtils.d.ts +1 -3
- package/lib/DateRangePicker/dateRangePickerUtils.js +113 -79
- package/lib/DateRangePicker/dateRangePickerUtils.js.map +1 -1
- package/lib/PieChart.d.ts +3 -10
- package/lib/PieChart.js +51 -103
- package/lib/PieChart.js.map +1 -1
- package/lib/QuillProvider.d.ts +1 -2
- package/lib/assets/ArrowDownHeadIcon.d.ts +1 -2
- package/lib/assets/ArrowDownIcon.d.ts +1 -2
- package/lib/assets/ArrowDownRightIcon.d.ts +1 -2
- package/lib/assets/ArrowLeftHeadIcon.d.ts +1 -2
- package/lib/assets/ArrowRightHeadIcon.d.ts +1 -2
- package/lib/assets/ArrowRightIcon.d.ts +1 -2
- package/lib/assets/ArrowUpHeadIcon.d.ts +1 -2
- package/lib/assets/ArrowUpIcon.d.ts +1 -2
- package/lib/assets/ArrowUpRightIcon.d.ts +1 -2
- package/lib/assets/CalendarIcon.d.ts +1 -2
- package/lib/assets/DoubleArrowLeftHeadIcon.d.ts +1 -2
- package/lib/assets/DoubleArrowRightHeadIcon.d.ts +1 -2
- package/lib/assets/ExclamationFilledIcon.d.ts +1 -2
- package/lib/assets/LoadingSpinner.d.ts +1 -2
- package/lib/assets/SearchIcon.d.ts +1 -2
- package/lib/assets/XCircleIcon.d.ts +1 -2
- package/lib/components/Dropdown/Dropdown.js +45 -14
- package/lib/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/Dropdown/DropdownItem.d.ts +1 -0
- package/lib/components/Dropdown/DropdownItem.js +21 -29
- package/lib/components/Dropdown/DropdownItem.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts +1 -0
- package/lib/components/Modal/Modal.js +47 -9
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/selectUtils.d.ts +1 -1
- package/lib/components/selectUtils.js +18 -12
- package/lib/components/selectUtils.js.map +1 -1
- package/lib/contexts/BaseColorContext.d.ts +1 -1
- package/lib/contexts/BaseColorContext.js +1 -2
- package/lib/contexts/BaseColorContext.js.map +1 -1
- package/lib/lib/index.d.ts +0 -7
- package/lib/lib/index.js +0 -7
- package/lib/lib/index.js.map +1 -1
- package/lib/lib/utils.d.ts +1 -4
- package/lib/lib/utils.js +4 -33
- package/lib/lib/utils.js.map +1 -1
- package/package.json +1 -8
- package/src/BarList.tsx +193 -96
- package/src/Chart.tsx +108 -48
- package/src/Dashboard.tsx +10 -10
- package/src/DateRangePicker/Calendar.tsx +149 -165
- package/src/DateRangePicker/DateRangePicker.tsx +11 -11
- package/src/DateRangePicker/DateRangePickerButton.tsx +129 -84
- package/src/DateRangePicker/dateRangePickerUtils.tsx +137 -117
- package/src/PieChart.tsx +87 -111
- package/src/components/Dropdown/Dropdown.tsx +50 -69
- package/src/components/Dropdown/DropdownItem.tsx +15 -50
- package/src/components/Modal/Modal.tsx +50 -31
- package/src/components/selectUtils.ts +19 -26
- package/src/contexts/BaseColorContext.tsx +1 -4
- package/src/lib/index.ts +0 -7
- package/src/lib/utils.tsx +8 -43
- package/src/styles.css +0 -5
- package/example/README.md +0 -46
- package/example/package-lock.json +0 -12111
- package/example/package.json +0 -43
- package/example/public/favicon.ico +0 -0
- package/example/public/index.html +0 -43
- package/example/public/logo192.png +0 -0
- package/example/public/logo512.png +0 -0
- package/example/public/manifest.json +0 -25
- package/example/public/robots.txt +0 -3
- package/example/src/App.css +0 -38
- package/example/src/App.test.tsx +0 -9
- package/example/src/App.tsx +0 -47
- package/example/src/index.css +0 -13
- package/example/src/index.tsx +0 -19
- package/example/src/logo.svg +0 -1
- package/example/src/react-app-env.d.ts +0 -1
- package/example/src/reportWebVitals.ts +0 -15
- package/example/src/setupTests.ts +0 -5
- package/example/tsconfig.json +0 -26
- package/postcss.config.js +0 -6
- package/src/lib/colorClassNames.ts +0 -3191
- package/src/lib/constants.ts +0 -58
- package/src/lib/hexColors.ts +0 -28
- package/src/lib/shape.ts +0 -75
- package/src/lib/sizing.ts +0 -47
- package/src/lib/spacing.ts +0 -264
- package/src/lib/theme.ts +0 -49
- package/tailwind.config.js +0 -23
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Dispatch, SetStateAction, useContext, useState } from 'react';
|
|
2
|
-
import { twMerge } from 'tailwind-merge';
|
|
2
|
+
// import { twMerge } from 'tailwind-merge';
|
|
3
3
|
import {
|
|
4
4
|
add,
|
|
5
5
|
eachDayOfInterval,
|
|
@@ -21,19 +21,7 @@ import {
|
|
|
21
21
|
DoubleArrowRightHeadIcon,
|
|
22
22
|
} from '../assets';
|
|
23
23
|
|
|
24
|
-
import {
|
|
25
|
-
border,
|
|
26
|
-
borderRadius,
|
|
27
|
-
boxShadow,
|
|
28
|
-
fontSize,
|
|
29
|
-
fontWeight,
|
|
30
|
-
getColorClassNames,
|
|
31
|
-
sizing,
|
|
32
|
-
spacing,
|
|
33
|
-
} from '../lib';
|
|
34
24
|
import { capitalize, getDateStyles, getWeekdays } from './dateRangePickerUtils';
|
|
35
|
-
import { DEFAULT_COLOR, colorPalette } from '../lib/theme';
|
|
36
|
-
import { makeDateRangePickerClassName } from './dateRangePickerUtils';
|
|
37
25
|
|
|
38
26
|
export const colStartClasses = [
|
|
39
27
|
'',
|
|
@@ -87,53 +75,49 @@ const CalendarHeader = ({
|
|
|
87
75
|
|
|
88
76
|
return (
|
|
89
77
|
<div
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
'
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
78
|
+
style={{
|
|
79
|
+
display: 'flex',
|
|
80
|
+
justifyContent: 'space-between',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
padding: '0.125rem',
|
|
83
|
+
paddingTop: '0.25rem',
|
|
84
|
+
paddingBottom: '0.25rem',
|
|
85
|
+
}}
|
|
96
86
|
>
|
|
97
87
|
<div
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
'
|
|
101
|
-
|
|
88
|
+
style={{
|
|
89
|
+
display: 'flex',
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
gap: '0.25rem',
|
|
92
|
+
}}
|
|
102
93
|
>
|
|
103
94
|
<button
|
|
95
|
+
type="button"
|
|
104
96
|
style={{
|
|
105
97
|
borderStyle: 'solid',
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
borderWidth: 1,
|
|
99
|
+
fontFamily: theme?.fontFamily,
|
|
100
|
+
borderColor: theme?.borderColor || '#E5E7EB',
|
|
108
101
|
background: theme?.backgroundColor || 'white',
|
|
102
|
+
display: 'inline-flex',
|
|
103
|
+
padding: '0.25rem',
|
|
104
|
+
marginRight: '0.0625rem',
|
|
105
|
+
fontSize: '0.875rem',
|
|
106
|
+
fontWeight: 500,
|
|
107
|
+
borderRadius: '0.25rem',
|
|
108
|
+
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
109
|
+
outline: enableYearPagination ? 'none' : '2px solid transparent',
|
|
110
|
+
outlineOffset: '2px',
|
|
111
|
+
cursor: 'pointer',
|
|
109
112
|
}}
|
|
110
|
-
type="button"
|
|
111
|
-
className={twMerge(
|
|
112
|
-
makeDateRangePickerClassName('calendarHeaderPrevYearButton'),
|
|
113
|
-
'qq-inline-flex focus:qq-outline-none focus:qq-ring-2',
|
|
114
|
-
!enableYearPagination && 'qq-hidden',
|
|
115
|
-
getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
116
|
-
.hoverBgColor,
|
|
117
|
-
getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor,
|
|
118
|
-
getColorClassNames('blue', colorPalette.lightRing).focusRingColor,
|
|
119
|
-
spacing.twoXs.paddingAll,
|
|
120
|
-
spacing.px.marginRight,
|
|
121
|
-
fontSize.sm,
|
|
122
|
-
fontWeight.md,
|
|
123
|
-
borderRadius.sm.all,
|
|
124
|
-
border.sm.all,
|
|
125
|
-
boxShadow.sm
|
|
126
|
-
)}
|
|
127
113
|
onClick={() => handlePaginationClick('prevYear')}
|
|
128
114
|
>
|
|
129
115
|
<DoubleArrowLeftHeadIcon
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
sizing.lg.width
|
|
136
|
-
)}
|
|
116
|
+
style={{
|
|
117
|
+
height: '1.25rem',
|
|
118
|
+
width: '1.25rem',
|
|
119
|
+
color: theme?.primaryTextColor || '#364153',
|
|
120
|
+
}}
|
|
137
121
|
aria-hidden="true"
|
|
138
122
|
/>
|
|
139
123
|
</button>
|
|
@@ -143,53 +127,51 @@ const CalendarHeader = ({
|
|
|
143
127
|
borderBottomWidth: 1,
|
|
144
128
|
borderBottomColor: theme?.borderColor || '#E5E7EB',
|
|
145
129
|
background: theme?.backgroundColor || 'white',
|
|
130
|
+
borderWidth: 1,
|
|
131
|
+
fontFamily: theme?.fontFamily,
|
|
132
|
+
borderColor: theme?.borderColor || '#E5E7EB',
|
|
133
|
+
display: 'inline-flex',
|
|
134
|
+
padding: '0.25rem',
|
|
135
|
+
marginRight: '0.0625rem',
|
|
136
|
+
fontSize: '0.875rem',
|
|
137
|
+
fontWeight: 500,
|
|
138
|
+
borderRadius: '0.25rem',
|
|
139
|
+
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
140
|
+
outline: enableYearPagination ? 'none' : '2px solid transparent',
|
|
141
|
+
outlineOffset: '2px',
|
|
142
|
+
cursor: 'pointer',
|
|
146
143
|
}}
|
|
147
144
|
type="button"
|
|
148
145
|
name="prevMonth"
|
|
149
|
-
className={twMerge(
|
|
150
|
-
makeDateRangePickerClassName('calendarHeaderPrevMonthButton'),
|
|
151
|
-
'qq-inline-flex focus:qq-outline-none focus:qq-ring-2',
|
|
152
|
-
getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
153
|
-
.hoverBgColor,
|
|
154
|
-
getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor,
|
|
155
|
-
getColorClassNames('blue', colorPalette.lightRing).focusRingColor,
|
|
156
|
-
spacing.twoXs.paddingAll,
|
|
157
|
-
fontSize.sm,
|
|
158
|
-
fontWeight.md,
|
|
159
|
-
borderRadius.sm.all,
|
|
160
|
-
border.sm.all,
|
|
161
|
-
boxShadow.sm
|
|
162
|
-
)}
|
|
163
146
|
onClick={() => handlePaginationClick('prevMonth')}
|
|
164
147
|
>
|
|
165
148
|
<ArrowLeftHeadIcon
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
sizing.lg.width
|
|
172
|
-
)}
|
|
149
|
+
style={{
|
|
150
|
+
height: '1.25rem',
|
|
151
|
+
width: '1.25rem',
|
|
152
|
+
color: theme?.primaryTextColor || '#364153',
|
|
153
|
+
}}
|
|
173
154
|
aria-hidden="true"
|
|
174
155
|
/>
|
|
175
156
|
</button>
|
|
176
157
|
</div>
|
|
177
158
|
<h2
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
'
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
)}
|
|
159
|
+
style={{
|
|
160
|
+
color: theme?.textColor || '#364153',
|
|
161
|
+
fontSize: '0.875rem',
|
|
162
|
+
fontFamily: theme?.fontFamily,
|
|
163
|
+
fontWeight: '700',
|
|
164
|
+
}}
|
|
185
165
|
>
|
|
186
166
|
{displayedTitle}
|
|
187
167
|
</h2>
|
|
188
168
|
<div
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
'
|
|
192
|
-
|
|
169
|
+
style={{
|
|
170
|
+
display: 'flex',
|
|
171
|
+
alignItems: 'center',
|
|
172
|
+
marginRight: '0.25rem',
|
|
173
|
+
marginLeft: '0.25rem',
|
|
174
|
+
}}
|
|
193
175
|
>
|
|
194
176
|
<button
|
|
195
177
|
style={{
|
|
@@ -197,33 +179,30 @@ const CalendarHeader = ({
|
|
|
197
179
|
borderBottomWidth: 1,
|
|
198
180
|
borderBottomColor: theme?.borderColor || '#E5E7EB',
|
|
199
181
|
background: theme?.backgroundColor || 'white',
|
|
182
|
+
borderWidth: 1,
|
|
183
|
+
borderColor: theme?.borderColor || '#E5E7EB',
|
|
184
|
+
fontFamily: theme?.fontFamily,
|
|
185
|
+
display: 'inline-flex',
|
|
186
|
+
padding: '0.25rem',
|
|
187
|
+
marginRight: '0.0625rem',
|
|
188
|
+
fontSize: '0.875rem',
|
|
189
|
+
fontWeight: 500,
|
|
190
|
+
borderRadius: '0.25rem',
|
|
191
|
+
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
192
|
+
outline: enableYearPagination ? 'none' : '2px solid transparent',
|
|
193
|
+
outlineOffset: '2px',
|
|
194
|
+
cursor: 'pointer',
|
|
200
195
|
}}
|
|
201
196
|
type="button"
|
|
202
197
|
name="nextMonth"
|
|
203
|
-
className={twMerge(
|
|
204
|
-
makeDateRangePickerClassName('calendarHeaderNextMonthButton'),
|
|
205
|
-
'qq-inline-flex focus:qq-outline-none focus:qq-ring-2',
|
|
206
|
-
getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
207
|
-
.hoverBgColor,
|
|
208
|
-
getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor,
|
|
209
|
-
getColorClassNames('blue', colorPalette.lightRing).focusRingColor,
|
|
210
|
-
spacing.twoXs.paddingAll,
|
|
211
|
-
fontSize.sm,
|
|
212
|
-
fontWeight.md,
|
|
213
|
-
borderRadius.sm.all,
|
|
214
|
-
border.sm.all,
|
|
215
|
-
boxShadow.sm
|
|
216
|
-
)}
|
|
217
198
|
onClick={() => handlePaginationClick('nextMonth')}
|
|
218
199
|
>
|
|
219
200
|
<ArrowRightHeadIcon
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
sizing.lg.width
|
|
226
|
-
)}
|
|
201
|
+
style={{
|
|
202
|
+
height: '1.25rem',
|
|
203
|
+
width: '1.25rem',
|
|
204
|
+
color: theme?.primaryTextColor || '#364153',
|
|
205
|
+
}}
|
|
227
206
|
aria-hidden="true"
|
|
228
207
|
/>
|
|
229
208
|
</button>
|
|
@@ -233,35 +212,27 @@ const CalendarHeader = ({
|
|
|
233
212
|
borderStyle: 'solid',
|
|
234
213
|
borderWidth: 1,
|
|
235
214
|
borderColor: theme?.borderColor || '#E5E7EB',
|
|
215
|
+
display: 'inline-flex',
|
|
216
|
+
padding: '0.25rem',
|
|
217
|
+
marginRight: '0.0625rem',
|
|
218
|
+
fontFamily: theme?.fontFamily,
|
|
219
|
+
fontSize: '0.875rem',
|
|
220
|
+
fontWeight: 500,
|
|
221
|
+
borderRadius: '0.25rem',
|
|
222
|
+
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
223
|
+
outline: enableYearPagination ? 'none' : '2px solid transparent',
|
|
224
|
+
outlineOffset: '2px',
|
|
225
|
+
cursor: 'pointer',
|
|
236
226
|
}}
|
|
237
227
|
type="button"
|
|
238
|
-
className={twMerge(
|
|
239
|
-
makeDateRangePickerClassName('calendarHeaderNextYearButton'),
|
|
240
|
-
'qq-inline-flex focus:qq-outline-none focus:qq-ring-2',
|
|
241
|
-
!enableYearPagination && 'hidden',
|
|
242
|
-
getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
243
|
-
.hoverBgColor,
|
|
244
|
-
getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor,
|
|
245
|
-
getColorClassNames('blue', colorPalette.lightRing).focusRingColor,
|
|
246
|
-
spacing.twoXs.paddingAll,
|
|
247
|
-
spacing.px.marginLeft,
|
|
248
|
-
fontSize.sm,
|
|
249
|
-
fontWeight.md,
|
|
250
|
-
borderRadius.sm.all,
|
|
251
|
-
border.sm.all,
|
|
252
|
-
boxShadow.sm
|
|
253
|
-
)}
|
|
254
228
|
onClick={() => handlePaginationClick('nextYear')}
|
|
255
229
|
>
|
|
256
230
|
<DoubleArrowRightHeadIcon
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
sizing.lg.height,
|
|
263
|
-
sizing.lg.width
|
|
264
|
-
)}
|
|
231
|
+
style={{
|
|
232
|
+
height: '1.25rem',
|
|
233
|
+
width: '1.25rem',
|
|
234
|
+
color: theme?.primaryTextColor || '#364153',
|
|
235
|
+
}}
|
|
265
236
|
aria-hidden="true"
|
|
266
237
|
/>
|
|
267
238
|
</button>
|
|
@@ -329,21 +300,29 @@ const CalendarBody = ({
|
|
|
329
300
|
return (
|
|
330
301
|
<>
|
|
331
302
|
<div
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
'
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
303
|
+
style={{
|
|
304
|
+
color: theme?.primaryTextColor || '#364153',
|
|
305
|
+
textAlign: 'center',
|
|
306
|
+
fontSize: '0.75rem',
|
|
307
|
+
fontWeight: '500',
|
|
308
|
+
display: 'grid',
|
|
309
|
+
gridTemplateColumns: 'repeat(7, minmax(0, 1fr))',
|
|
310
|
+
}}
|
|
339
311
|
>
|
|
340
312
|
{weekdays.map(dayName => (
|
|
341
|
-
<div
|
|
313
|
+
<div
|
|
314
|
+
key={dayName}
|
|
315
|
+
style={{ width: '100%', display: 'flex', justifyContent: 'center' }}
|
|
316
|
+
>
|
|
342
317
|
<div
|
|
343
|
-
|
|
344
|
-
'
|
|
345
|
-
|
|
346
|
-
|
|
318
|
+
style={{
|
|
319
|
+
display: 'flex',
|
|
320
|
+
alignItems: 'center',
|
|
321
|
+
justifyContent: 'center',
|
|
322
|
+
width: '100%',
|
|
323
|
+
height: '2.25rem',
|
|
324
|
+
fontFamily: theme?.fontFamily,
|
|
325
|
+
}}
|
|
347
326
|
>
|
|
348
327
|
{dayName}
|
|
349
328
|
</div>
|
|
@@ -351,10 +330,11 @@ const CalendarBody = ({
|
|
|
351
330
|
))}
|
|
352
331
|
</div>
|
|
353
332
|
<div
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
'
|
|
357
|
-
|
|
333
|
+
style={{
|
|
334
|
+
display: 'grid',
|
|
335
|
+
gridTemplateColumns: 'repeat(7, minmax(0, 1fr))',
|
|
336
|
+
paddingBottom: 8,
|
|
337
|
+
}}
|
|
358
338
|
>
|
|
359
339
|
{displayedDates.map(date => {
|
|
360
340
|
const isCurrentDateDisabled = isDateDisabled(
|
|
@@ -366,33 +346,30 @@ const CalendarBody = ({
|
|
|
366
346
|
);
|
|
367
347
|
|
|
368
348
|
return (
|
|
369
|
-
<div
|
|
370
|
-
key={date.toString()}
|
|
371
|
-
className={twMerge(
|
|
372
|
-
makeDateRangePickerClassName('calendarBodyDate'),
|
|
373
|
-
colStartClasses[getDay(date)],
|
|
374
|
-
'qq-w-full'
|
|
375
|
-
)}
|
|
376
|
-
>
|
|
349
|
+
<div key={date.toString()} style={{ width: '100%' }}>
|
|
377
350
|
<button
|
|
378
|
-
style={{
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
'
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
351
|
+
style={{
|
|
352
|
+
border: 'none',
|
|
353
|
+
height: '1.5rem',
|
|
354
|
+
display: 'flex',
|
|
355
|
+
width: '100%',
|
|
356
|
+
alignItems: 'center',
|
|
357
|
+
justifyContent: 'center',
|
|
358
|
+
fontFamily: theme?.fontFamily,
|
|
359
|
+
...getDateStyles(
|
|
360
|
+
theme,
|
|
388
361
|
date,
|
|
389
362
|
selectedStartDate,
|
|
390
363
|
selectedEndDate,
|
|
391
364
|
hoveredDate,
|
|
392
|
-
isCurrentDateDisabled
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
365
|
+
isCurrentDateDisabled
|
|
366
|
+
),
|
|
367
|
+
}}
|
|
368
|
+
type="button"
|
|
369
|
+
onClick={() => onDateClick(date)}
|
|
370
|
+
onPointerEnter={() => setHoveredDate?.(date)}
|
|
371
|
+
onPointerLeave={() => setHoveredDate?.(undefined)}
|
|
372
|
+
// className={twMerge(fontSize.sm)}
|
|
396
373
|
disabled={isCurrentDateDisabled}
|
|
397
374
|
>
|
|
398
375
|
<time dateTime={format(date, 'yyyy-MM-dd', { locale })}>
|
|
@@ -433,7 +410,14 @@ const Calendar = ({
|
|
|
433
410
|
theme,
|
|
434
411
|
}: CalendarProps) => {
|
|
435
412
|
return (
|
|
436
|
-
<div
|
|
413
|
+
<div
|
|
414
|
+
style={{
|
|
415
|
+
paddingLeft: '0.75rem',
|
|
416
|
+
paddingRight: '0.75rem',
|
|
417
|
+
paddingTop: '0.25rem',
|
|
418
|
+
paddingBottom: '0.25rem',
|
|
419
|
+
}}
|
|
420
|
+
>
|
|
437
421
|
<CalendarHeader
|
|
438
422
|
enableYearPagination={enableYearPagination}
|
|
439
423
|
anchorDate={anchorDate}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/display-name */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
import React, { useRef, useState } from 'react';
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
4
|
|
|
6
5
|
import { startOfMonth, startOfToday, sub } from 'date-fns';
|
|
7
6
|
import { enUS } from 'date-fns/locale';
|
|
@@ -18,7 +17,6 @@ import {
|
|
|
18
17
|
defaultOptions,
|
|
19
18
|
getEndDateByDropdownValue,
|
|
20
19
|
getStartDateByDropdownValue,
|
|
21
|
-
makeDateRangePickerClassName,
|
|
22
20
|
parseEndDate,
|
|
23
21
|
parseStartDate,
|
|
24
22
|
} from './dateRangePickerUtils';
|
|
@@ -175,11 +173,12 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
|
175
173
|
<BaseColorContext.Provider value={color}>
|
|
176
174
|
<div
|
|
177
175
|
ref={ref}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
176
|
+
style={{ position: 'relative', width: '100%' }}
|
|
177
|
+
// className={twMerge(
|
|
178
|
+
// makeDateRangePickerClassName('root'),
|
|
179
|
+
// 'qq-relative qq-w-full',
|
|
180
|
+
// className
|
|
181
|
+
// )}
|
|
183
182
|
{...other}
|
|
184
183
|
>
|
|
185
184
|
<DateRangePickerButton
|
|
@@ -202,12 +201,12 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
|
202
201
|
/>
|
|
203
202
|
{/* Calendar Modal */}
|
|
204
203
|
<Modal
|
|
205
|
-
|
|
204
|
+
theme={theme}
|
|
206
205
|
showModal={showCalendar}
|
|
207
206
|
setShowModal={setShowCalendar}
|
|
208
207
|
parentRef={calendarRef}
|
|
209
208
|
width={288}
|
|
210
|
-
maxHeight="
|
|
209
|
+
maxHeight="fit-content"
|
|
211
210
|
>
|
|
212
211
|
<Calendar
|
|
213
212
|
enableYearPagination={enableYearPagination}
|
|
@@ -225,10 +224,10 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
|
225
224
|
</Modal>
|
|
226
225
|
{/* Dropdpown Modal */}
|
|
227
226
|
<Modal
|
|
228
|
-
className={makeDateRangePickerClassName('dropdownModal')}
|
|
229
227
|
showModal={showDropdown}
|
|
230
228
|
setShowModal={setShowDropdown}
|
|
231
229
|
parentRef={dropdownRef}
|
|
230
|
+
theme={theme}
|
|
232
231
|
>
|
|
233
232
|
<SelectedValueContext.Provider
|
|
234
233
|
value={{
|
|
@@ -240,12 +239,13 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
|
240
239
|
value={{ hoveredValue: hoveredDropdownValue }}
|
|
241
240
|
>
|
|
242
241
|
{dropdownOptions.map(
|
|
243
|
-
({ value, text }: DateRangePickerOption) => (
|
|
242
|
+
({ value, text }: DateRangePickerOption, index: number) => (
|
|
244
243
|
<DropdownItem
|
|
245
244
|
key={value}
|
|
246
245
|
value={value}
|
|
247
246
|
text={text}
|
|
248
247
|
theme={theme}
|
|
248
|
+
lastItem={dropdownOptions.length - 1 === index}
|
|
249
249
|
/>
|
|
250
250
|
)
|
|
251
251
|
)}
|