@quillsql/react 1.1.2 → 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 +8 -5
- package/lib/BarList.js.map +1 -1
- package/lib/Chart.d.ts +4 -2
- package/lib/Chart.js +59 -21
- package/lib/Chart.js.map +1 -1
- package/lib/Dashboard.js +10 -7
- package/lib/Dashboard.js.map +1 -1
- package/lib/DateRangePicker/Calendar.d.ts +2 -1
- package/lib/DateRangePicker/Calendar.js +29 -9
- 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 +9 -4
- package/lib/PieChart.js.map +1 -1
- package/lib/components/Dropdown/Dropdown.d.ts +1 -0
- package/lib/components/Dropdown/Dropdown.js +8 -3
- 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/styles.css +10192 -5444
- package/package.json +1 -1
- package/src/BarList.tsx +11 -5
- package/src/Chart.tsx +74 -17
- package/src/Dashboard.tsx +10 -6
- package/src/DateRangePicker/Calendar.tsx +33 -0
- package/src/DateRangePicker/DateRangePicker.tsx +10 -1
- package/src/DateRangePicker/DateRangePickerButton.tsx +24 -0
- package/src/PieChart.tsx +10 -2
- package/src/components/Dropdown/Dropdown.tsx +9 -0
- package/src/components/Dropdown/DropdownItem.tsx +19 -2
- package/tailwind.config.js +3 -0
package/package.json
CHANGED
package/src/BarList.tsx
CHANGED
|
@@ -138,6 +138,7 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
138
138
|
ref={ref}
|
|
139
139
|
style={{
|
|
140
140
|
width: '100%',
|
|
141
|
+
height: '100%',
|
|
141
142
|
marginLeft: 25,
|
|
142
143
|
// background: 'red',
|
|
143
144
|
marginTop: 20,
|
|
@@ -155,7 +156,7 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
155
156
|
<div
|
|
156
157
|
// className={twMerge(makeBarListClassName('bars'), 'relative w-full')}
|
|
157
158
|
className="qq-relative-w-full"
|
|
158
|
-
style={{ width: '100%' }}
|
|
159
|
+
style={{ width: '100%', height: '100%' }}
|
|
159
160
|
>
|
|
160
161
|
{data.slice(0, Math.floor(NUM_TO_SHOW / 2)).map((item, idx) => {
|
|
161
162
|
// const Icon = item.icon;
|
|
@@ -181,7 +182,10 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
181
182
|
{item[xAxisField]}
|
|
182
183
|
</p>
|
|
183
184
|
</div>
|
|
184
|
-
<div
|
|
185
|
+
<div
|
|
186
|
+
style={{ width: '100%', height: '100%' }}
|
|
187
|
+
className="qq-flex qq-flex-col"
|
|
188
|
+
>
|
|
185
189
|
<div
|
|
186
190
|
className={`qq-flex qq-items-center qq-h-9 qq-rounded qq-mb-2`}
|
|
187
191
|
style={{
|
|
@@ -286,7 +290,9 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
286
290
|
ref={ref}
|
|
287
291
|
style={{
|
|
288
292
|
width: '100%',
|
|
289
|
-
|
|
293
|
+
height: '100%',
|
|
294
|
+
// height: hei
|
|
295
|
+
// marginLeft: 25,
|
|
290
296
|
// background: 'red',
|
|
291
297
|
marginTop: 20,
|
|
292
298
|
paddingRight: 25,
|
|
@@ -294,7 +300,7 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
294
300
|
}}
|
|
295
301
|
className={twMerge(
|
|
296
302
|
// makeBarListClassName('root'),
|
|
297
|
-
'qq-flex qq-justify-between',
|
|
303
|
+
'qq-flex qq-justify-between qq-h-full qq-w-full',
|
|
298
304
|
'qq-space-x-6',
|
|
299
305
|
className
|
|
300
306
|
)}
|
|
@@ -303,7 +309,7 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
303
309
|
<div
|
|
304
310
|
// className={twMerge(makeBarListClassName('bars'), 'relative w-full')}
|
|
305
311
|
className="qq-relative-w-full"
|
|
306
|
-
style={{ width: '100%' }}
|
|
312
|
+
style={{ width: 'calc(100%)', height: '100%', paddingLeft: 25 }}
|
|
307
313
|
>
|
|
308
314
|
{data.slice(0, NUM_TO_SHOW).map((item, idx) => {
|
|
309
315
|
// const Icon = item.icon;
|
package/src/Chart.tsx
CHANGED
|
@@ -199,11 +199,17 @@ const labelFormatter = (name: string) => {
|
|
|
199
199
|
|
|
200
200
|
export const ChartTooltipFrame = ({
|
|
201
201
|
children,
|
|
202
|
+
theme,
|
|
202
203
|
}: {
|
|
203
204
|
children: React.ReactNode;
|
|
204
205
|
}) => (
|
|
205
206
|
<div
|
|
206
|
-
|
|
207
|
+
style={{
|
|
208
|
+
borderStyle: 'solid',
|
|
209
|
+
borderColor: theme.borderColor || '#E5E7EB',
|
|
210
|
+
borderWidth: 1,
|
|
211
|
+
}}
|
|
212
|
+
className="qq-bg-white qq-text-sm qq-rounded-md qq-shadow-lg"
|
|
207
213
|
// className={twMerge(
|
|
208
214
|
// 'bg-white',
|
|
209
215
|
// 'font-normal',
|
|
@@ -221,17 +227,24 @@ export interface ChartTooltipRowProps {
|
|
|
221
227
|
value: string;
|
|
222
228
|
name: string;
|
|
223
229
|
color: Color;
|
|
230
|
+
thee: any;
|
|
224
231
|
}
|
|
225
232
|
|
|
226
233
|
export const ChartTooltipRow = ({
|
|
227
234
|
value,
|
|
228
235
|
name,
|
|
229
236
|
color,
|
|
237
|
+
theme,
|
|
230
238
|
}: ChartTooltipRowProps) => (
|
|
231
239
|
<div className="qq-flex qq-items-center qq-justify-between qq-space-x-8">
|
|
232
240
|
<div className="qq-flex qq-items-center qq-space-x-2">
|
|
233
241
|
<span
|
|
234
|
-
style={{
|
|
242
|
+
style={{
|
|
243
|
+
background: color,
|
|
244
|
+
borderWidth: 2,
|
|
245
|
+
borderStyle: 'solid',
|
|
246
|
+
borderColor: 'white',
|
|
247
|
+
}}
|
|
235
248
|
className={twMerge(
|
|
236
249
|
// 'shrink-0',
|
|
237
250
|
// 'bg-black',
|
|
@@ -252,12 +265,24 @@ export const ChartTooltipRow = ({
|
|
|
252
265
|
// 'font-medium tabular-nums text-right whitespace-nowrap',
|
|
253
266
|
// 'text-[#212121] !important'
|
|
254
267
|
// )}
|
|
268
|
+
style={{
|
|
269
|
+
marginTop: 0,
|
|
270
|
+
marginBottom: 0,
|
|
271
|
+
fontFamily: theme.fontFamily,
|
|
272
|
+
color: theme.primaryTextColor,
|
|
273
|
+
}}
|
|
255
274
|
className="qq-font-medium qq-tabular-nums qq-text-right qq-whitespace-nowrap qq-text-black"
|
|
256
275
|
>
|
|
257
276
|
{value}
|
|
258
277
|
</p>
|
|
259
278
|
</div>
|
|
260
279
|
<p
|
|
280
|
+
style={{
|
|
281
|
+
marginTop: 0,
|
|
282
|
+
marginBottom: 0,
|
|
283
|
+
fontFamily: theme.fontFamily,
|
|
284
|
+
color: theme.secondaryTextColor,
|
|
285
|
+
}}
|
|
261
286
|
className={twMerge(
|
|
262
287
|
'qq-text-right qq-whitespace-nowrap',
|
|
263
288
|
// getColorClassNames(DEFAULT_COLOR, colorPalette.text).textColor,
|
|
@@ -276,6 +301,7 @@ export interface ChartTooltipProps {
|
|
|
276
301
|
label: string;
|
|
277
302
|
colors: string[];
|
|
278
303
|
valueFormatter: any;
|
|
304
|
+
theme: any;
|
|
279
305
|
}
|
|
280
306
|
|
|
281
307
|
const ChartTooltip = ({
|
|
@@ -284,12 +310,21 @@ const ChartTooltip = ({
|
|
|
284
310
|
label,
|
|
285
311
|
colors,
|
|
286
312
|
valueFormatter,
|
|
313
|
+
theme,
|
|
287
314
|
}: ChartTooltipProps) => {
|
|
288
315
|
if (active && payload) {
|
|
289
316
|
return (
|
|
290
|
-
<ChartTooltipFrame>
|
|
317
|
+
<ChartTooltipFrame theme={theme}>
|
|
291
318
|
<div
|
|
292
|
-
|
|
319
|
+
style={{
|
|
320
|
+
borderStyle: 'solid',
|
|
321
|
+
borderBottomColor: theme.borderColor || '#E5E7EB',
|
|
322
|
+
borderTop: 'none',
|
|
323
|
+
borderLeft: 'none',
|
|
324
|
+
borderRight: 'none',
|
|
325
|
+
borderBottomWidth: 1,
|
|
326
|
+
}}
|
|
327
|
+
className="qq-flex qq-flex-col qq-py-2 qq-px-4 qq-gray-200"
|
|
293
328
|
// className={
|
|
294
329
|
// twMerge()
|
|
295
330
|
// getColorClassNames(DEFAULT_COLOR, colorPalette.lightBorder)
|
|
@@ -300,7 +335,13 @@ const ChartTooltip = ({
|
|
|
300
335
|
// }
|
|
301
336
|
>
|
|
302
337
|
<p
|
|
303
|
-
style={{
|
|
338
|
+
style={{
|
|
339
|
+
textAlign: 'left',
|
|
340
|
+
marginTop: 0,
|
|
341
|
+
marginBottom: 0,
|
|
342
|
+
fontFamily: theme.fontFamily,
|
|
343
|
+
color: theme.primaryTextColor,
|
|
344
|
+
}}
|
|
304
345
|
className={twMerge(
|
|
305
346
|
'qq-text-elem',
|
|
306
347
|
'qq-text-black',
|
|
@@ -335,6 +376,7 @@ const ChartTooltip = ({
|
|
|
335
376
|
name={labelFormatter(name)}
|
|
336
377
|
// color={categoryColors.get(name) ?? BaseColors.Blue}
|
|
337
378
|
color={colors[idx]}
|
|
379
|
+
theme={theme}
|
|
338
380
|
/>
|
|
339
381
|
)
|
|
340
382
|
)}
|
|
@@ -519,16 +561,25 @@ const ChartUpdater: React.FC<ChartProps> = ({
|
|
|
519
561
|
className="flex flex-col flex-1 h-[100%]"
|
|
520
562
|
style={{ ...containerStyle, marginLeft: 25 }}
|
|
521
563
|
>
|
|
522
|
-
<
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
564
|
+
<div style={{ height: containerStyle?.height || 300, width: '100%' }}>
|
|
565
|
+
<Skeleton
|
|
566
|
+
count={1}
|
|
567
|
+
// height={containerStyle?.height}
|
|
568
|
+
height={
|
|
569
|
+
containerStyle?.height && containerStyle?.marginTop
|
|
570
|
+
? containerStyle?.height + containerStyle?.marginTop
|
|
571
|
+
: containerStyle?.height
|
|
572
|
+
? containerStyle?.height
|
|
573
|
+
: 300
|
|
574
|
+
}
|
|
575
|
+
borderRadius={8}
|
|
576
|
+
// highlightColor="#F7F7F8"
|
|
577
|
+
highlightColor="#FDFDFD"
|
|
578
|
+
// baseColor="#F3F4F6"
|
|
579
|
+
baseColor="#F9F9FA"
|
|
580
|
+
width="100%"
|
|
581
|
+
/>
|
|
582
|
+
</div>
|
|
532
583
|
</div>
|
|
533
584
|
);
|
|
534
585
|
}
|
|
@@ -550,6 +601,7 @@ const ChartUpdater: React.FC<ChartProps> = ({
|
|
|
550
601
|
category={yAxisFields[0].field}
|
|
551
602
|
index={xAxisField}
|
|
552
603
|
colors={colors}
|
|
604
|
+
theme={theme}
|
|
553
605
|
/>
|
|
554
606
|
);
|
|
555
607
|
}
|
|
@@ -597,7 +649,7 @@ const ChartUpdater: React.FC<ChartProps> = ({
|
|
|
597
649
|
return (
|
|
598
650
|
<div
|
|
599
651
|
style={{
|
|
600
|
-
|
|
652
|
+
fontFamily: theme.fontFamily,
|
|
601
653
|
fontSize: 32,
|
|
602
654
|
color: theme.primaryTextColor,
|
|
603
655
|
fontWeight: '600',
|
|
@@ -609,7 +661,7 @@ const ChartUpdater: React.FC<ChartProps> = ({
|
|
|
609
661
|
maxWidth: '100%',
|
|
610
662
|
textAlign: 'left',
|
|
611
663
|
overflow: 'hidden',
|
|
612
|
-
height: '100%',
|
|
664
|
+
height: containerStyle?.height || '100%',
|
|
613
665
|
// background: 'red',
|
|
614
666
|
}}
|
|
615
667
|
className="qq-flex qq-flex-col qq-text-xl"
|
|
@@ -631,6 +683,7 @@ const ChartUpdater: React.FC<ChartProps> = ({
|
|
|
631
683
|
xAxisField={chartConfig.xAxisField}
|
|
632
684
|
xAxisLabel={chartConfig.xAxisLabel}
|
|
633
685
|
containerStyle={containerStyle}
|
|
686
|
+
theme={theme}
|
|
634
687
|
/>
|
|
635
688
|
);
|
|
636
689
|
};
|
|
@@ -803,6 +856,7 @@ function BarChart({
|
|
|
803
856
|
content={({ active, payload, label }) => {
|
|
804
857
|
return (
|
|
805
858
|
<ChartTooltip
|
|
859
|
+
theme={theme}
|
|
806
860
|
active={active}
|
|
807
861
|
payload={payload}
|
|
808
862
|
label={label}
|
|
@@ -845,6 +899,7 @@ function LineChart({
|
|
|
845
899
|
containerStyle,
|
|
846
900
|
xAxisField,
|
|
847
901
|
xAxisLabel,
|
|
902
|
+
theme,
|
|
848
903
|
}: {
|
|
849
904
|
colors: string[];
|
|
850
905
|
yAxisFields: any[];
|
|
@@ -852,6 +907,7 @@ function LineChart({
|
|
|
852
907
|
containerStyle?: React.CSSProperties;
|
|
853
908
|
xAxisField: string;
|
|
854
909
|
xAxisLabel: string;
|
|
910
|
+
theme: any;
|
|
855
911
|
}) {
|
|
856
912
|
// console.log('CONTAINER: ', containerStyle);
|
|
857
913
|
if (!yAxisFields || !yAxisFields.length) {
|
|
@@ -922,6 +978,7 @@ function LineChart({
|
|
|
922
978
|
label={label}
|
|
923
979
|
valueFormatter={valueFormatter}
|
|
924
980
|
colors={colors}
|
|
981
|
+
theme={theme}
|
|
925
982
|
/>
|
|
926
983
|
);
|
|
927
984
|
}}
|
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]
|
|
@@ -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,
|
|
@@ -345,8 +346,9 @@ export default function Dashboard({
|
|
|
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 = (
|
|
@@ -99,6 +101,12 @@ const CalendarHeader = ({
|
|
|
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'),
|
|
@@ -130,6 +138,12 @@ 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(
|
|
@@ -178,6 +192,12 @@ const CalendarHeader = ({
|
|
|
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(
|
|
@@ -208,6 +228,12 @@ 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'),
|
|
@@ -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);
|
|
@@ -347,6 +375,7 @@ const CalendarBody = ({
|
|
|
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)}
|
|
@@ -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
|
|
|
@@ -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
|
|
@@ -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
|
|
|
@@ -83,6 +85,13 @@ 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}
|
|
@@ -115,6 +124,11 @@ 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
134
|
'qq-whitespace-nowrap qq-truncate',
|
|
@@ -128,6 +142,11 @@ 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(
|
|
@@ -146,6 +165,11 @@ 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
175
|
'qq-whitespace-nowrap qq-truncate',
|
package/src/PieChart.tsx
CHANGED
|
@@ -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="qq-bg-white qq-text-sm qq-rounded-md qq-
|
|
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',
|
|
@@ -415,7 +416,12 @@ export const ChartTooltipRow = ({
|
|
|
415
416
|
<div className="qq-flex qq-items-center qq-justify-between qq-space-x-8">
|
|
416
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',
|
|
@@ -436,12 +442,14 @@ export const ChartTooltipRow = ({
|
|
|
436
442
|
// 'font-medium tabular-nums text-right whitespace-nowrap',
|
|
437
443
|
// 'text-[#212121] !important'
|
|
438
444
|
// )}
|
|
445
|
+
style={{ marginTop: 0, marginBottom: 0 }}
|
|
439
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
454
|
'qq-text-right qq-whitespace-nowrap',
|
|
447
455
|
// getColorClassNames(DEFAULT_COLOR, colorPalette.text).textColor,
|
|
@@ -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(
|
|
@@ -98,6 +100,12 @@ const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
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'),
|
|
@@ -131,6 +139,7 @@ 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
145
|
'qq-whitespace-nowrap qq-truncate',
|