@quillsql/react 1.1.1 → 1.1.3
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/example/src/App.tsx +2 -3
- package/lib/BarList.js +19 -16
- package/lib/BarList.js.map +1 -1
- package/lib/Chart.d.ts +4 -2
- package/lib/Chart.js +65 -27
- package/lib/Chart.js.map +1 -1
- package/lib/Dashboard.js +13 -10
- package/lib/Dashboard.js.map +1 -1
- package/lib/DateRangePicker/Calendar.d.ts +2 -1
- package/lib/DateRangePicker/Calendar.js +31 -11
- package/lib/DateRangePicker/Calendar.js.map +1 -1
- package/lib/DateRangePicker/DateRangePicker.d.ts +1 -0
- package/lib/DateRangePicker/DateRangePicker.js +4 -4
- package/lib/DateRangePicker/DateRangePicker.js.map +1 -1
- package/lib/DateRangePicker/DateRangePickerButton.d.ts +2 -1
- package/lib/DateRangePicker/DateRangePickerButton.js +22 -4
- package/lib/DateRangePicker/DateRangePickerButton.js.map +1 -1
- package/lib/PieChart.js +14 -9
- package/lib/PieChart.js.map +1 -1
- package/lib/components/Dropdown/Dropdown.d.ts +1 -0
- package/lib/components/Dropdown/Dropdown.js +10 -5
- package/lib/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/Dropdown/DropdownItem.d.ts +1 -0
- package/lib/components/Dropdown/DropdownItem.js +19 -3
- package/lib/components/Dropdown/DropdownItem.js.map +1 -1
- package/lib/components/Modal/Modal.js +1 -1
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/lib/colorClassNames.js +3094 -3094
- package/lib/lib/colorClassNames.js.map +1 -1
- package/lib/lib/constants.d.ts +1 -1
- package/lib/lib/constants.js +36 -36
- package/lib/lib/constants.js.map +1 -1
- package/lib/lib/font.js +9 -9
- package/lib/lib/font.js.map +1 -1
- package/lib/lib/hexColors.js +25 -25
- package/lib/lib/index.d.ts +10 -10
- package/lib/lib/index.js +10 -10
- package/lib/lib/inputTypes.d.ts +4 -4
- package/lib/lib/inputTypes.js +50 -31
- package/lib/lib/inputTypes.js.map +1 -1
- package/lib/lib/shape.js +49 -49
- package/lib/lib/shape.js.map +1 -1
- package/lib/lib/sizing.js +20 -20
- package/lib/lib/sizing.js.map +1 -1
- package/lib/lib/spacing.js +238 -238
- package/lib/lib/spacing.js.map +1 -1
- package/lib/styles.css +12915 -9139
- package/package.json +4 -2
- package/prefix-classnames.js +50 -0
- package/src/BarList.tsx +71 -45
- package/src/Chart.tsx +97 -34
- package/src/Dashboard.tsx +14 -10
- package/src/DateRangePicker/Calendar.tsx +49 -16
- package/src/DateRangePicker/DateRangePicker.tsx +12 -3
- package/src/DateRangePicker/DateRangePickerButton.tsx +31 -7
- package/src/PieChart.tsx +22 -14
- package/src/components/Dropdown/Dropdown.tsx +15 -6
- package/src/components/Dropdown/DropdownItem.tsx +22 -5
- package/src/components/Modal/Modal.tsx +2 -2
- package/src/lib/colorClassNames.ts +3094 -3094
- package/src/lib/constants.ts +43 -37
- package/src/lib/font.ts +9 -9
- package/src/lib/hexColors.ts +25 -25
- package/src/lib/index.ts +10 -10
- package/src/lib/inputTypes.ts +54 -35
- package/src/lib/shape.ts +49 -49
- package/src/lib/sizing.ts +20 -20
- package/src/lib/spacing.ts +238 -238
- package/tailwind.config.js +1 -1
package/src/Dashboard.tsx
CHANGED
|
@@ -99,6 +99,7 @@ export default function Dashboard({
|
|
|
99
99
|
// change to be set on the dashboard / section as default date range
|
|
100
100
|
defaultValue={[undefined, undefined, '90d']}
|
|
101
101
|
onValueChange={onChangeDateFilter}
|
|
102
|
+
theme={theme}
|
|
102
103
|
/>
|
|
103
104
|
</div>
|
|
104
105
|
{Object.keys(dashboardSections)
|
|
@@ -148,7 +149,7 @@ export default function Dashboard({
|
|
|
148
149
|
gridTemplateColumns: `repeat(auto-fill,minmax(${
|
|
149
150
|
maxColumnWidth || 400
|
|
150
151
|
}px, 1fr))`,
|
|
151
|
-
|
|
152
|
+
gridTemplateRows: `repeat(${170}px)`,
|
|
152
153
|
}}
|
|
153
154
|
>
|
|
154
155
|
{dashboardSections[section]
|
|
@@ -176,7 +177,7 @@ export default function Dashboard({
|
|
|
176
177
|
onClick={() => handleOnClickDashboardItem(elem._id)}
|
|
177
178
|
className={
|
|
178
179
|
onClickDashboardItem
|
|
179
|
-
? 'hover:bg-zinc-50'
|
|
180
|
+
? 'hover:qq-bg-zinc-50'
|
|
180
181
|
: undefined
|
|
181
182
|
}
|
|
182
183
|
key={elem.name + '' + index}
|
|
@@ -272,8 +273,8 @@ export default function Dashboard({
|
|
|
272
273
|
containerStyle={{
|
|
273
274
|
display: 'flex',
|
|
274
275
|
width: '100%',
|
|
275
|
-
height:
|
|
276
|
-
marginBottom: 50,
|
|
276
|
+
height: 30,
|
|
277
|
+
// marginBottom: 50,
|
|
277
278
|
marginTop: 20,
|
|
278
279
|
}}
|
|
279
280
|
isDateFilter={true}
|
|
@@ -293,7 +294,7 @@ export default function Dashboard({
|
|
|
293
294
|
) : null}
|
|
294
295
|
<div
|
|
295
296
|
style={{
|
|
296
|
-
width: `100%`,
|
|
297
|
+
// width: `100%`,
|
|
297
298
|
listStyleType: 'none',
|
|
298
299
|
display: 'grid',
|
|
299
300
|
gridGap: 25,
|
|
@@ -332,21 +333,22 @@ export default function Dashboard({
|
|
|
332
333
|
}
|
|
333
334
|
className={
|
|
334
335
|
onClickDashboardItem
|
|
335
|
-
? 'hover:bg-zinc-50'
|
|
336
|
+
? 'hover:qq-bg-zinc-50'
|
|
336
337
|
: undefined
|
|
337
338
|
}
|
|
338
|
-
// className="shadow-md"
|
|
339
|
+
// className="qq-shadow-md"
|
|
339
340
|
key={elem.name + '' + index}
|
|
340
341
|
// onClick={() => handleEditDashboardItem(elem)}
|
|
341
|
-
// className="shadow"
|
|
342
|
+
// className="qq-shadow"
|
|
342
343
|
style={{
|
|
343
344
|
// background: theme.elevatedCardColor,
|
|
344
345
|
// borderRadius: theme.borderRadius,
|
|
345
346
|
// boxShadow: theme.boxShadow,
|
|
346
347
|
height: '100%',
|
|
347
348
|
cursor: 'pointer',
|
|
348
|
-
width: '100%',
|
|
349
|
+
// width: '100%',
|
|
349
350
|
paddingRight: 25,
|
|
351
|
+
minHeight: rowHeight || 400,
|
|
350
352
|
borderRadius: 8,
|
|
351
353
|
paddingTop: 20,
|
|
352
354
|
}}
|
|
@@ -368,6 +370,7 @@ export default function Dashboard({
|
|
|
368
370
|
display: 'flex',
|
|
369
371
|
flexDirection: 'column',
|
|
370
372
|
justifyContent: 'space-between',
|
|
373
|
+
height: '100%',
|
|
371
374
|
}}
|
|
372
375
|
>
|
|
373
376
|
<div
|
|
@@ -423,11 +426,12 @@ export default function Dashboard({
|
|
|
423
426
|
{/* <Arrow fill={theme.fontColor} /> */}
|
|
424
427
|
</div>
|
|
425
428
|
{/* <div style={{ height: 20 }} /> */}
|
|
426
|
-
<div style={{ padding: 0 }}>
|
|
429
|
+
<div style={{ padding: 0, height: '100%' }}>
|
|
427
430
|
<Chart
|
|
428
431
|
containerStyle={{
|
|
429
432
|
display: 'flex',
|
|
430
433
|
width: '100%',
|
|
434
|
+
// TODO: fix fixed height
|
|
431
435
|
height: 300,
|
|
432
436
|
marginBottom: 50,
|
|
433
437
|
marginTop: 30,
|
|
@@ -50,6 +50,7 @@ interface CalendarHeaderProps {
|
|
|
50
50
|
anchorDate: Date;
|
|
51
51
|
setStartOfCurrMonth: Dispatch<SetStateAction<Date | null>>;
|
|
52
52
|
locale: Locale;
|
|
53
|
+
theme: any;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
const CalendarHeader = ({
|
|
@@ -57,6 +58,7 @@ const CalendarHeader = ({
|
|
|
57
58
|
anchorDate,
|
|
58
59
|
setStartOfCurrMonth,
|
|
59
60
|
locale,
|
|
61
|
+
theme,
|
|
60
62
|
}: CalendarHeaderProps) => {
|
|
61
63
|
const firstDayOfMonth = startOfMonth(anchorDate);
|
|
62
64
|
const handlePaginationClick = (
|
|
@@ -87,7 +89,7 @@ const CalendarHeader = ({
|
|
|
87
89
|
<div
|
|
88
90
|
className={twMerge(
|
|
89
91
|
makeDateRangePickerClassName('calendarHeader'),
|
|
90
|
-
'flex justify-between items-center',
|
|
92
|
+
'qq-flex qq-justify-between qq-items-center',
|
|
91
93
|
spacing.twoXs.paddingX,
|
|
92
94
|
spacing.sm.paddingY
|
|
93
95
|
)}
|
|
@@ -95,15 +97,21 @@ const CalendarHeader = ({
|
|
|
95
97
|
<div
|
|
96
98
|
className={twMerge(
|
|
97
99
|
makeDateRangePickerClassName('calendarHeaderPrevSelection'),
|
|
98
|
-
'flex items-center space-x-1'
|
|
100
|
+
'qq-flex qq-items-center qq-space-x-1'
|
|
99
101
|
)}
|
|
100
102
|
>
|
|
101
103
|
<button
|
|
104
|
+
style={{
|
|
105
|
+
borderStyle: 'solid',
|
|
106
|
+
borderBottomWidth: 1,
|
|
107
|
+
borderBottomColor: theme?.borderColor || '#E5E7EB',
|
|
108
|
+
background: theme?.backgroundColor || 'white',
|
|
109
|
+
}}
|
|
102
110
|
type="button"
|
|
103
111
|
className={twMerge(
|
|
104
112
|
makeDateRangePickerClassName('calendarHeaderPrevYearButton'),
|
|
105
|
-
'inline-flex focus:outline-none focus:ring-2',
|
|
106
|
-
!enableYearPagination && 'hidden',
|
|
113
|
+
'qq-inline-flex focus:qq-outline-none focus:qq-ring-2',
|
|
114
|
+
!enableYearPagination && 'qq-hidden',
|
|
107
115
|
getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
108
116
|
.hoverBgColor,
|
|
109
117
|
getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor,
|
|
@@ -130,11 +138,17 @@ const CalendarHeader = ({
|
|
|
130
138
|
/>
|
|
131
139
|
</button>
|
|
132
140
|
<button
|
|
141
|
+
style={{
|
|
142
|
+
borderStyle: 'solid',
|
|
143
|
+
borderBottomWidth: 1,
|
|
144
|
+
borderBottomColor: theme?.borderColor || '#E5E7EB',
|
|
145
|
+
background: theme?.backgroundColor || 'white',
|
|
146
|
+
}}
|
|
133
147
|
type="button"
|
|
134
148
|
name="prevMonth"
|
|
135
149
|
className={twMerge(
|
|
136
150
|
makeDateRangePickerClassName('calendarHeaderPrevMonthButton'),
|
|
137
|
-
'inline-flex focus:outline-none focus:ring-2',
|
|
151
|
+
'qq-inline-flex focus:qq-outline-none focus:qq-ring-2',
|
|
138
152
|
getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
139
153
|
.hoverBgColor,
|
|
140
154
|
getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor,
|
|
@@ -163,7 +177,7 @@ const CalendarHeader = ({
|
|
|
163
177
|
<h2
|
|
164
178
|
className={twMerge(
|
|
165
179
|
makeDateRangePickerClassName('calendarHeaderText'),
|
|
166
|
-
'text-elem',
|
|
180
|
+
'qq-text-elem',
|
|
167
181
|
getColorClassNames(DEFAULT_COLOR, colorPalette.darkestText).textColor,
|
|
168
182
|
fontSize.sm,
|
|
169
183
|
fontWeight.lg
|
|
@@ -174,15 +188,21 @@ const CalendarHeader = ({
|
|
|
174
188
|
<div
|
|
175
189
|
className={twMerge(
|
|
176
190
|
makeDateRangePickerClassName('calendarHeaderNextSelection'),
|
|
177
|
-
'flex items-center space-x-1'
|
|
191
|
+
'qq-flex qq-items-center qq-space-x-1'
|
|
178
192
|
)}
|
|
179
193
|
>
|
|
180
194
|
<button
|
|
195
|
+
style={{
|
|
196
|
+
borderStyle: 'solid',
|
|
197
|
+
borderBottomWidth: 1,
|
|
198
|
+
borderBottomColor: theme?.borderColor || '#E5E7EB',
|
|
199
|
+
background: theme?.backgroundColor || 'white',
|
|
200
|
+
}}
|
|
181
201
|
type="button"
|
|
182
202
|
name="nextMonth"
|
|
183
203
|
className={twMerge(
|
|
184
204
|
makeDateRangePickerClassName('calendarHeaderNextMonthButton'),
|
|
185
|
-
'inline-flex focus:outline-none focus:ring-2',
|
|
205
|
+
'qq-inline-flex focus:qq-outline-none focus:qq-ring-2',
|
|
186
206
|
getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
187
207
|
.hoverBgColor,
|
|
188
208
|
getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor,
|
|
@@ -208,10 +228,16 @@ const CalendarHeader = ({
|
|
|
208
228
|
/>
|
|
209
229
|
</button>
|
|
210
230
|
<button
|
|
231
|
+
style={{
|
|
232
|
+
background: theme?.backgroundColor || 'white',
|
|
233
|
+
borderStyle: 'solid',
|
|
234
|
+
borderWidth: 1,
|
|
235
|
+
borderColor: theme?.borderColor || '#E5E7EB',
|
|
236
|
+
}}
|
|
211
237
|
type="button"
|
|
212
238
|
className={twMerge(
|
|
213
239
|
makeDateRangePickerClassName('calendarHeaderNextYearButton'),
|
|
214
|
-
'inline-flex focus:outline-none focus:ring-2',
|
|
240
|
+
'qq-inline-flex focus:qq-outline-none focus:qq-ring-2',
|
|
215
241
|
!enableYearPagination && 'hidden',
|
|
216
242
|
getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
217
243
|
.hoverBgColor,
|
|
@@ -230,7 +256,7 @@ const CalendarHeader = ({
|
|
|
230
256
|
<DoubleArrowRightHeadIcon
|
|
231
257
|
className={twMerge(
|
|
232
258
|
makeDateRangePickerClassName('calendarHeaderNextYearIcon'),
|
|
233
|
-
'shrink-0 flex-0',
|
|
259
|
+
'qq-shrink-0 qq-flex-0',
|
|
234
260
|
getColorClassNames(DEFAULT_COLOR, colorPalette.darkText)
|
|
235
261
|
.textColor,
|
|
236
262
|
sizing.lg.height,
|
|
@@ -252,6 +278,7 @@ interface CalendarBodyProps {
|
|
|
252
278
|
minDate: Date | null;
|
|
253
279
|
maxDate: Date | null;
|
|
254
280
|
locale: Locale;
|
|
281
|
+
theme: any;
|
|
255
282
|
}
|
|
256
283
|
|
|
257
284
|
const CalendarBody = ({
|
|
@@ -262,6 +289,7 @@ const CalendarBody = ({
|
|
|
262
289
|
minDate,
|
|
263
290
|
maxDate,
|
|
264
291
|
locale,
|
|
292
|
+
theme,
|
|
265
293
|
}: CalendarBodyProps) => {
|
|
266
294
|
const [hoveredDate, setHoveredDate] = useState<Date | undefined>();
|
|
267
295
|
const color = useContext(BaseColorContext);
|
|
@@ -303,17 +331,17 @@ const CalendarBody = ({
|
|
|
303
331
|
<div
|
|
304
332
|
className={twMerge(
|
|
305
333
|
makeDateRangePickerClassName('calendarBodyWeekdays'),
|
|
306
|
-
'grid grid-cols-7 text-center',
|
|
334
|
+
'qq-grid qq-grid-cols-7 qq-text-center',
|
|
307
335
|
getColorClassNames(DEFAULT_COLOR, colorPalette.ring).textColor,
|
|
308
336
|
fontSize.xs,
|
|
309
337
|
fontWeight.md
|
|
310
338
|
)}
|
|
311
339
|
>
|
|
312
340
|
{weekdays.map(dayName => (
|
|
313
|
-
<div key={dayName} className="w-full flex justify-center">
|
|
341
|
+
<div key={dayName} className="qq-w-full qq-flex qq-justify-center">
|
|
314
342
|
<div
|
|
315
343
|
className={twMerge(
|
|
316
|
-
'flex items-center justify-center w-full',
|
|
344
|
+
'qq-flex qq-items-center qq-justify-center qq-w-full',
|
|
317
345
|
sizing.threeXl.height
|
|
318
346
|
)}
|
|
319
347
|
>
|
|
@@ -325,7 +353,7 @@ const CalendarBody = ({
|
|
|
325
353
|
<div
|
|
326
354
|
className={twMerge(
|
|
327
355
|
makeDateRangePickerClassName('calendarBodyDatesGrid'),
|
|
328
|
-
'grid grid-cols-7'
|
|
356
|
+
'qq-grid qq-grid-cols-7'
|
|
329
357
|
)}
|
|
330
358
|
>
|
|
331
359
|
{displayedDates.map(date => {
|
|
@@ -343,16 +371,17 @@ const CalendarBody = ({
|
|
|
343
371
|
className={twMerge(
|
|
344
372
|
makeDateRangePickerClassName('calendarBodyDate'),
|
|
345
373
|
colStartClasses[getDay(date)],
|
|
346
|
-
'w-full'
|
|
374
|
+
'qq-w-full'
|
|
347
375
|
)}
|
|
348
376
|
>
|
|
349
377
|
<button
|
|
378
|
+
style={{ border: 'none' }}
|
|
350
379
|
type="button"
|
|
351
380
|
onClick={() => onDateClick(date)}
|
|
352
381
|
onPointerEnter={() => setHoveredDate?.(date)}
|
|
353
382
|
onPointerLeave={() => setHoveredDate?.(undefined)}
|
|
354
383
|
className={twMerge(
|
|
355
|
-
'w-full flex items-center justify-center',
|
|
384
|
+
'qq-w-full qq-flex qq-items-center qq-justify-center',
|
|
356
385
|
sizing.threeXl.height,
|
|
357
386
|
fontSize.sm,
|
|
358
387
|
getDateStyles(
|
|
@@ -388,6 +417,7 @@ export interface CalendarProps {
|
|
|
388
417
|
maxDate: Date | null;
|
|
389
418
|
onDateClick: (date: Date) => void;
|
|
390
419
|
locale: Locale;
|
|
420
|
+
theme: any;
|
|
391
421
|
}
|
|
392
422
|
|
|
393
423
|
const Calendar = ({
|
|
@@ -400,6 +430,7 @@ const Calendar = ({
|
|
|
400
430
|
maxDate,
|
|
401
431
|
onDateClick,
|
|
402
432
|
locale,
|
|
433
|
+
theme,
|
|
403
434
|
}: CalendarProps) => {
|
|
404
435
|
return (
|
|
405
436
|
<div className={twMerge(spacing.lg.paddingX, spacing.twoXs.paddingY)}>
|
|
@@ -408,6 +439,7 @@ const Calendar = ({
|
|
|
408
439
|
anchorDate={anchorDate}
|
|
409
440
|
setStartOfCurrMonth={setStartOfCurrMonth}
|
|
410
441
|
locale={locale}
|
|
442
|
+
theme={theme}
|
|
411
443
|
/>
|
|
412
444
|
<CalendarBody
|
|
413
445
|
anchorDate={anchorDate}
|
|
@@ -417,6 +449,7 @@ const Calendar = ({
|
|
|
417
449
|
minDate={minDate}
|
|
418
450
|
maxDate={maxDate}
|
|
419
451
|
locale={locale}
|
|
452
|
+
theme={theme}
|
|
420
453
|
/>
|
|
421
454
|
</div>
|
|
422
455
|
);
|
|
@@ -57,6 +57,7 @@ export interface DateRangePickerProps
|
|
|
57
57
|
disabled?: boolean;
|
|
58
58
|
color?: string;
|
|
59
59
|
locale?: Locale;
|
|
60
|
+
theme: any;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
@@ -76,6 +77,7 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
|
76
77
|
enableYearPagination = false,
|
|
77
78
|
locale = enUS,
|
|
78
79
|
className,
|
|
80
|
+
theme,
|
|
79
81
|
...other
|
|
80
82
|
} = props;
|
|
81
83
|
|
|
@@ -175,7 +177,7 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
|
175
177
|
ref={ref}
|
|
176
178
|
className={twMerge(
|
|
177
179
|
makeDateRangePickerClassName('root'),
|
|
178
|
-
'relative w-full',
|
|
180
|
+
'qq-relative qq-w-full',
|
|
179
181
|
className
|
|
180
182
|
)}
|
|
181
183
|
{...other}
|
|
@@ -196,6 +198,7 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
|
196
198
|
onDropdownKeyDown={handleDropdownKeyDown}
|
|
197
199
|
locale={locale}
|
|
198
200
|
dropdownPlaceholder={dropdownPlaceholder}
|
|
201
|
+
theme={theme}
|
|
199
202
|
/>
|
|
200
203
|
{/* Calendar Modal */}
|
|
201
204
|
<Modal
|
|
@@ -204,7 +207,7 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
|
204
207
|
setShowModal={setShowCalendar}
|
|
205
208
|
parentRef={calendarRef}
|
|
206
209
|
width={288}
|
|
207
|
-
maxHeight="max-h-fit"
|
|
210
|
+
maxHeight="qq-max-h-fit"
|
|
208
211
|
>
|
|
209
212
|
<Calendar
|
|
210
213
|
enableYearPagination={enableYearPagination}
|
|
@@ -217,6 +220,7 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
|
217
220
|
onDateClick={handleDateClick}
|
|
218
221
|
locale={locale}
|
|
219
222
|
setStartOfCurrMonth={setStartOfCurrMonth}
|
|
223
|
+
theme={theme}
|
|
220
224
|
/>
|
|
221
225
|
</Modal>
|
|
222
226
|
{/* Dropdpown Modal */}
|
|
@@ -237,7 +241,12 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
|
237
241
|
>
|
|
238
242
|
{dropdownOptions.map(
|
|
239
243
|
({ value, text }: DateRangePickerOption) => (
|
|
240
|
-
<DropdownItem
|
|
244
|
+
<DropdownItem
|
|
245
|
+
key={value}
|
|
246
|
+
value={value}
|
|
247
|
+
text={text}
|
|
248
|
+
theme={theme}
|
|
249
|
+
/>
|
|
241
250
|
)
|
|
242
251
|
)}
|
|
243
252
|
</HoveredValueContext.Provider>
|
|
@@ -39,6 +39,7 @@ interface DateRangePickerButtonProps {
|
|
|
39
39
|
onDropdownKeyDown: (e: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
40
40
|
locale?: Locale;
|
|
41
41
|
dropdownPlaceholder?: string;
|
|
42
|
+
theme: any;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
const DateRangePickerButton = ({
|
|
@@ -57,6 +58,7 @@ const DateRangePickerButton = ({
|
|
|
57
58
|
onDropdownKeyDown,
|
|
58
59
|
locale,
|
|
59
60
|
dropdownPlaceholder = 'Select',
|
|
61
|
+
theme,
|
|
60
62
|
}: DateRangePickerButtonProps) => {
|
|
61
63
|
const [startDate, endDate, dropdownValue] = value;
|
|
62
64
|
|
|
@@ -75,7 +77,7 @@ const DateRangePickerButton = ({
|
|
|
75
77
|
<div
|
|
76
78
|
className={twMerge(
|
|
77
79
|
makeDateRangePickerClassName('button'),
|
|
78
|
-
'flex items-center justify-between',
|
|
80
|
+
'qq-flex qq-items-center qq-justify-between',
|
|
79
81
|
getColorClassNames('white').bgColor,
|
|
80
82
|
borderRadius.md.all,
|
|
81
83
|
boxShadow.sm
|
|
@@ -83,12 +85,19 @@ const DateRangePickerButton = ({
|
|
|
83
85
|
>
|
|
84
86
|
<button
|
|
85
87
|
type="button"
|
|
88
|
+
style={{
|
|
89
|
+
borderColor: theme?.borderColor || '#E5E7EB',
|
|
90
|
+
borderStyle: 'solid',
|
|
91
|
+
fontFamily: theme?.fontFamily,
|
|
92
|
+
color: theme?.primaryTextColor,
|
|
93
|
+
cursor: 'pointer',
|
|
94
|
+
}}
|
|
86
95
|
ref={calendarRef}
|
|
87
96
|
onClick={() => setShowCalendar(!showCalendar)}
|
|
88
97
|
onKeyDown={onCalendarKeyDown}
|
|
89
98
|
className={twMerge(
|
|
90
99
|
makeDateRangePickerClassName('calendarButton'),
|
|
91
|
-
'flex items-center w-full truncate focus:outline-none focus:ring-2',
|
|
100
|
+
'qq-flex qq-items-center qq-w-full qq-truncate focus:qq-outline-none focus:qq-ring-2',
|
|
92
101
|
getSelectButtonColors(hasDateSelection, disabled),
|
|
93
102
|
enableDropdown
|
|
94
103
|
? border.none.right
|
|
@@ -105,7 +114,7 @@ const DateRangePickerButton = ({
|
|
|
105
114
|
<CalendarIcon
|
|
106
115
|
className={twMerge(
|
|
107
116
|
makeDateRangePickerClassName('calendarButtonIcon'),
|
|
108
|
-
'flex-none',
|
|
117
|
+
'qq-flex-none',
|
|
109
118
|
getColorClassNames(DEFAULT_COLOR, colorPalette.lightText).textColor,
|
|
110
119
|
sizing.lg.height,
|
|
111
120
|
sizing.lg.width,
|
|
@@ -115,9 +124,14 @@ const DateRangePickerButton = ({
|
|
|
115
124
|
aria-hidden="true"
|
|
116
125
|
/>
|
|
117
126
|
<p
|
|
127
|
+
style={{
|
|
128
|
+
margin: 0,
|
|
129
|
+
fontFamily: theme?.fontFamily,
|
|
130
|
+
color: theme?.primaryTextColor,
|
|
131
|
+
}}
|
|
118
132
|
className={twMerge(
|
|
119
133
|
makeDateRangePickerClassName('calendarButtonText'),
|
|
120
|
-
'whitespace-nowrap truncate',
|
|
134
|
+
'qq-whitespace-nowrap qq-truncate',
|
|
121
135
|
fontSize.sm,
|
|
122
136
|
fontWeight.md
|
|
123
137
|
)}
|
|
@@ -128,11 +142,16 @@ const DateRangePickerButton = ({
|
|
|
128
142
|
{enableDropdown ? (
|
|
129
143
|
<button
|
|
130
144
|
type="button"
|
|
145
|
+
style={{
|
|
146
|
+
borderColor: theme?.borderColor || '#E5E7EB',
|
|
147
|
+
borderStyle: 'solid',
|
|
148
|
+
cursor: 'pointer',
|
|
149
|
+
}}
|
|
131
150
|
ref={dropdownRef}
|
|
132
151
|
onClick={() => setShowDropdown(!showDropdown)}
|
|
133
152
|
className={twMerge(
|
|
134
153
|
makeDateRangePickerClassName('dropdownButton'),
|
|
135
|
-
'inline-flex justify-between w-48 truncate focus:outline-none focus:ring-2',
|
|
154
|
+
'qq-inline-flex qq-justify-between qq-w-48 qq-truncate focus:qq-outline-none focus:qq-ring-2',
|
|
136
155
|
getSelectButtonColors(hasDropdownSelection, disabled),
|
|
137
156
|
getColorClassNames(BaseColors.Blue, colorPalette.lightRing)
|
|
138
157
|
.focusRingColor,
|
|
@@ -146,9 +165,14 @@ const DateRangePickerButton = ({
|
|
|
146
165
|
disabled={disabled}
|
|
147
166
|
>
|
|
148
167
|
<p
|
|
168
|
+
style={{
|
|
169
|
+
margin: 0,
|
|
170
|
+
fontFamily: theme?.fontFamily,
|
|
171
|
+
color: theme?.primaryTextColor,
|
|
172
|
+
}}
|
|
149
173
|
className={twMerge(
|
|
150
174
|
makeDateRangePickerClassName('dropdownButtonText'),
|
|
151
|
-
'whitespace-nowrap truncate',
|
|
175
|
+
'qq-whitespace-nowrap qq-truncate',
|
|
152
176
|
fontSize.sm,
|
|
153
177
|
fontWeight.md
|
|
154
178
|
)}
|
|
@@ -158,7 +182,7 @@ const DateRangePickerButton = ({
|
|
|
158
182
|
<ArrowDownHeadIcon
|
|
159
183
|
className={twMerge(
|
|
160
184
|
makeDateRangePickerClassName('dropdownButtonIcon'),
|
|
161
|
-
'flex-none',
|
|
185
|
+
'qq-flex-none',
|
|
162
186
|
sizing.lg.height,
|
|
163
187
|
sizing.lg.width,
|
|
164
188
|
spacing.twoXs.negativeMarginRight,
|
package/src/PieChart.tsx
CHANGED
|
@@ -135,7 +135,7 @@ const ChartLegend = (categories: string[], colors: string[]) => {
|
|
|
135
135
|
// });
|
|
136
136
|
|
|
137
137
|
return (
|
|
138
|
-
<div ref={legendRef} className="flex items-center justify-end">
|
|
138
|
+
<div ref={legendRef} className="qq-flex qq-items-center qq-justify-end">
|
|
139
139
|
<Legend
|
|
140
140
|
// @ts-ignore
|
|
141
141
|
categories={categories}
|
|
@@ -386,8 +386,9 @@ export const ChartTooltipFrame = ({
|
|
|
386
386
|
children: React.ReactNode;
|
|
387
387
|
}) => (
|
|
388
388
|
<div
|
|
389
|
+
style={{ borderStyle: 'solid', borderColor: '#E5E7EB', borderWidth: 1 }}
|
|
389
390
|
// style={{ transform: 'translateX(-120px)' }}
|
|
390
|
-
className="bg-white text-sm rounded-md
|
|
391
|
+
className="qq-bg-white qq-text-sm qq-rounded-md qq-shadow-lg"
|
|
391
392
|
// className={twMerge(
|
|
392
393
|
// 'bg-white',
|
|
393
394
|
// 'font-normal',
|
|
@@ -412,10 +413,15 @@ export const ChartTooltipRow = ({
|
|
|
412
413
|
name,
|
|
413
414
|
color,
|
|
414
415
|
}: ChartTooltipRowProps) => (
|
|
415
|
-
<div className="flex items-center justify-between space-x-8">
|
|
416
|
-
<div className="flex items-center space-x-2">
|
|
416
|
+
<div className="qq-flex qq-items-center qq-justify-between qq-space-x-8">
|
|
417
|
+
<div className="qq-flex qq-items-center qq-space-x-2">
|
|
417
418
|
<span
|
|
418
|
-
style={{
|
|
419
|
+
style={{
|
|
420
|
+
background: color,
|
|
421
|
+
borderWidth: 2,
|
|
422
|
+
borderStyle: 'solid',
|
|
423
|
+
borderColor: 'white',
|
|
424
|
+
}}
|
|
419
425
|
className={twMerge(
|
|
420
426
|
// 'shrink-0',
|
|
421
427
|
// 'bg-black',
|
|
@@ -423,10 +429,10 @@ export const ChartTooltipRow = ({
|
|
|
423
429
|
// 'border-black',
|
|
424
430
|
// sizing.sm.height,
|
|
425
431
|
// sizing.sm.width,
|
|
426
|
-
'h-3',
|
|
427
|
-
'w-3',
|
|
428
|
-
'shadow',
|
|
429
|
-
'rounded-full'
|
|
432
|
+
'qq-h-3',
|
|
433
|
+
'qq-w-3',
|
|
434
|
+
'qq-shadow',
|
|
435
|
+
'qq-rounded-full'
|
|
430
436
|
// border.md.all,
|
|
431
437
|
// boxShadow.md
|
|
432
438
|
)}
|
|
@@ -436,16 +442,18 @@ export const ChartTooltipRow = ({
|
|
|
436
442
|
// 'font-medium tabular-nums text-right whitespace-nowrap',
|
|
437
443
|
// 'text-[#212121] !important'
|
|
438
444
|
// )}
|
|
439
|
-
|
|
445
|
+
style={{ marginTop: 0, marginBottom: 0 }}
|
|
446
|
+
className="qq-font-medium qq-tabular-nums qq-text-right qq-whitespace-nowrap qq-text-black"
|
|
440
447
|
>
|
|
441
448
|
{value}
|
|
442
449
|
</p>
|
|
443
450
|
</div>
|
|
444
451
|
<p
|
|
452
|
+
style={{ marginTop: 0, marginBottom: 0 }}
|
|
445
453
|
className={twMerge(
|
|
446
|
-
'text-right whitespace-nowrap',
|
|
454
|
+
'qq-text-right qq-whitespace-nowrap',
|
|
447
455
|
// getColorClassNames(DEFAULT_COLOR, colorPalette.text).textColor,
|
|
448
|
-
'text-gray-500'
|
|
456
|
+
'qq-text-gray-500'
|
|
449
457
|
// fontWeight.sm
|
|
450
458
|
)}
|
|
451
459
|
>
|
|
@@ -471,7 +479,7 @@ export const DonutChartTooltip = ({
|
|
|
471
479
|
<ChartTooltipFrame>
|
|
472
480
|
<div
|
|
473
481
|
// style={{ transform: 'translateX(-120px)' }}
|
|
474
|
-
className={twMerge('px-4', 'py-2')}
|
|
482
|
+
className={twMerge('qq-px-4', 'qq-py-2')}
|
|
475
483
|
>
|
|
476
484
|
<ChartTooltipRow
|
|
477
485
|
value={valueFormatter(payloadRow.value)}
|
|
@@ -825,7 +833,7 @@ function Legend2({ payload, colors }: { payload: any; colors: string[] }) {
|
|
|
825
833
|
display: 'block',
|
|
826
834
|
maxWidth: 120,
|
|
827
835
|
}}
|
|
828
|
-
className="text-sm text-gray-600 whitespace-nowrap overflow-hidden overflow-ellipsis text-sm font-normal"
|
|
836
|
+
className="qq-text-sm qq-text-gray-600 qq-whitespace-nowrap qq-overflow-hidden qq-overflow-ellipsis qq-text-sm qq-font-normal"
|
|
829
837
|
>
|
|
830
838
|
{item.value}
|
|
831
839
|
</div>
|
|
@@ -40,6 +40,7 @@ export interface DropdownProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
40
40
|
disabled?: boolean;
|
|
41
41
|
icon?: React.JSXElementConstructor<any>;
|
|
42
42
|
children: React.ReactElement[] | React.ReactElement;
|
|
43
|
+
theme: any;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(
|
|
@@ -53,6 +54,7 @@ const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
53
54
|
icon,
|
|
54
55
|
children,
|
|
55
56
|
className,
|
|
57
|
+
theme,
|
|
56
58
|
...other
|
|
57
59
|
} = props;
|
|
58
60
|
const [selectedValue, setSelectedValue] = useInternalState(
|
|
@@ -92,16 +94,22 @@ const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
92
94
|
onKeyDown={handleKeyDown}
|
|
93
95
|
className={twMerge(
|
|
94
96
|
makeDropdownClassName('root'),
|
|
95
|
-
'relative w-full min-w-[10rem]',
|
|
97
|
+
'qq-relative qq-w-full qq-min-w-[10rem]',
|
|
96
98
|
className
|
|
97
99
|
)}
|
|
98
100
|
{...other}
|
|
99
101
|
>
|
|
100
102
|
<button
|
|
103
|
+
style={{
|
|
104
|
+
// borderColor: theme.borderColor || '#E5E7EB',
|
|
105
|
+
// borderStyle: 'solid',
|
|
106
|
+
border: 'none',
|
|
107
|
+
background: 'white',
|
|
108
|
+
}}
|
|
101
109
|
type="button"
|
|
102
110
|
className={twMerge(
|
|
103
111
|
makeDropdownClassName('button'),
|
|
104
|
-
'flex justify-between items-center w-full focus:outline-none focus:ring-2',
|
|
112
|
+
'qq-flex qq-justify-between qq-items-center qq-w-full focus:qq-outline-none focus:qq-ring-2',
|
|
105
113
|
getSelectButtonColors(hasSelection, disabled),
|
|
106
114
|
getColorClassNames(BaseColors.Blue, colorPalette.lightRing)
|
|
107
115
|
.focusRingColor,
|
|
@@ -115,12 +123,12 @@ const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
115
123
|
onClick={() => setIsFocused(!isFocused)}
|
|
116
124
|
disabled={disabled}
|
|
117
125
|
>
|
|
118
|
-
<div className="flex justify-start items-center truncate">
|
|
126
|
+
<div className="qq-flex qq-justify-start qq-items-center qq-truncate">
|
|
119
127
|
{Icon ? (
|
|
120
128
|
<Icon
|
|
121
129
|
className={twMerge(
|
|
122
130
|
makeDropdownClassName('icon'),
|
|
123
|
-
'shrink-0',
|
|
131
|
+
'qq-shrink-0',
|
|
124
132
|
sizing.lg.height,
|
|
125
133
|
sizing.lg.width,
|
|
126
134
|
getColorClassNames(DEFAULT_COLOR, colorPalette.lightText)
|
|
@@ -131,9 +139,10 @@ const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
131
139
|
/>
|
|
132
140
|
) : null}
|
|
133
141
|
<p
|
|
142
|
+
style={{ margin: 0 }}
|
|
134
143
|
className={twMerge(
|
|
135
144
|
makeDropdownClassName('text'),
|
|
136
|
-
'whitespace-nowrap truncate',
|
|
145
|
+
'qq-whitespace-nowrap qq-truncate',
|
|
137
146
|
fontSize.sm,
|
|
138
147
|
fontWeight.md
|
|
139
148
|
)}
|
|
@@ -146,7 +155,7 @@ const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
146
155
|
<ArrowDownHeadIcon
|
|
147
156
|
className={twMerge(
|
|
148
157
|
makeDropdownClassName('arrowDownIcon'),
|
|
149
|
-
'flex-none',
|
|
158
|
+
'qq-flex-none',
|
|
150
159
|
sizing.lg.height,
|
|
151
160
|
sizing.lg.width,
|
|
152
161
|
spacing.twoXs.negativeMarginRight,
|