@quillsql/react 1.1.0 → 1.1.2
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.js +16 -15
- package/lib/BarList.js.map +1 -1
- package/lib/Chart.js +11 -11
- package/lib/Chart.js.map +1 -1
- package/lib/Context.js +1 -0
- package/lib/Context.js.map +1 -1
- package/lib/Dashboard.js +4 -3
- package/lib/Dashboard.js.map +1 -1
- package/lib/DateRangePicker/Calendar.js +7 -7
- package/lib/DateRangePicker/Calendar.js.map +1 -1
- package/lib/DateRangePicker/DateRangePicker.js +2 -1
- package/lib/DateRangePicker/DateRangePicker.js.map +1 -1
- package/lib/DateRangePicker/DateRangePickerButton.js +3 -3
- package/lib/DateRangePicker/DateRangePickerButton.js.map +1 -1
- package/lib/DateRangePicker/index.d.ts +2 -2
- package/lib/DateRangePicker/index.js +2 -1
- package/lib/DateRangePicker/index.js.map +1 -1
- package/lib/PieChart.js +9 -8
- package/lib/PieChart.js.map +1 -1
- package/lib/QuillProvider.js.map +1 -1
- package/lib/components/Dropdown/Dropdown.js +4 -4
- package/lib/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/Dropdown/DropdownItem.js +2 -2
- 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/contexts/BaseColorContext.d.ts +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 +2813 -3785
- package/package.json +4 -2
- package/prefix-classnames.js +50 -0
- package/src/BarList.tsx +67 -46
- package/src/Chart.tsx +26 -21
- package/src/Context.tsx +1 -0
- package/src/Dashboard.tsx +5 -6
- package/src/DateRangePicker/Calendar.tsx +16 -16
- package/src/DateRangePicker/DateRangePicker.tsx +3 -2
- package/src/DateRangePicker/DateRangePickerButton.tsx +7 -7
- package/src/DateRangePicker/index.ts +3 -2
- package/src/PieChart.tsx +15 -14
- package/src/QuillProvider.tsx +1 -0
- package/src/components/Dropdown/Dropdown.tsx +6 -6
- package/src/components/Dropdown/DropdownItem.tsx +3 -3
- 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 +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quillsql/react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"access": "public",
|
|
5
5
|
"description": "Quill React components for building dashboards and reporting.",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"lint:fix": "eslint --fix 'src/**/*.{ts,tsx}'",
|
|
12
12
|
"prettier": "prettier --check 'src/**/*.{ts,tsx}'",
|
|
13
13
|
"prettier:fix": "prettier --write 'src/**/*.{ts,tsx}'",
|
|
14
|
-
"build:css": "postcss src/styles.css -o lib/styles.css"
|
|
14
|
+
"build:css": "postcss src/styles.css -o lib/styles.css",
|
|
15
|
+
"prefix-classnames": "node ./prefix-classnames.js"
|
|
15
16
|
},
|
|
16
17
|
"keywords": [],
|
|
17
18
|
"author": "",
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
"eslint-config-prettier": "^8.8.0",
|
|
42
43
|
"eslint-plugin-prettier": "^4.2.1",
|
|
43
44
|
"eslint-plugin-react": "^7.32.2",
|
|
45
|
+
"glob": "^10.2.2",
|
|
44
46
|
"postcss": "^8.4.21",
|
|
45
47
|
"postcss-cli": "^10.1.0",
|
|
46
48
|
"prettier": "^2.8.7"
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { glob } = require('glob');
|
|
4
|
+
|
|
5
|
+
const rootDir = path.resolve(__dirname);
|
|
6
|
+
const classNameRegex = /className=["']([\w\s-]+)["']/g;
|
|
7
|
+
|
|
8
|
+
console.log('Root directory:', rootDir);
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
const files = glob.sync('**/*.{js,jsx,tsx}', {
|
|
12
|
+
cwd: rootDir,
|
|
13
|
+
ignore: '**/node_modules/**',
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
console.log('Files found:', files);
|
|
17
|
+
|
|
18
|
+
files.forEach(file => {
|
|
19
|
+
console.log('Processing file:', file);
|
|
20
|
+
const filePath = path.join(rootDir, file);
|
|
21
|
+
fs.readFile(filePath, 'utf-8', (err, data) => {
|
|
22
|
+
if (err) {
|
|
23
|
+
console.error('Error reading file:', err);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const result = data.replace(classNameRegex, (match, p1) => {
|
|
28
|
+
const classNames = p1.split(' ');
|
|
29
|
+
const prefixedClassNames = classNames.map(className => {
|
|
30
|
+
if (className.startsWith('qq-')) {
|
|
31
|
+
return className;
|
|
32
|
+
} else {
|
|
33
|
+
return `qq-${className}`;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return `className="${prefixedClassNames.join(' ')}"`;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
fs.writeFile(filePath, result, 'utf-8', err => {
|
|
40
|
+
if (err) {
|
|
41
|
+
console.error('Error writing file:', err);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
console.log('File updated successfully:', filePath);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error('Error in glob.sync():', error);
|
|
50
|
+
}
|
package/src/BarList.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react/display-name */
|
|
2
|
+
// @ts-nocheck
|
|
2
3
|
import React, { useState } from 'react';
|
|
3
4
|
import { twMerge } from 'tailwind-merge';
|
|
4
5
|
import {
|
|
@@ -97,12 +98,12 @@ const valueFormatter = (number: number) => {
|
|
|
97
98
|
|
|
98
99
|
function hexToRgbaWith10PercentAlpha(hex) {
|
|
99
100
|
// Convert the hex color to RGB
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
const r = parseInt(hex.slice(1, 3), 16);
|
|
102
|
+
const g = parseInt(hex.slice(3, 5), 16);
|
|
103
|
+
const b = parseInt(hex.slice(5, 7), 16);
|
|
103
104
|
|
|
104
105
|
// Set the alpha value to 10%
|
|
105
|
-
|
|
106
|
+
const alpha = 0.1;
|
|
106
107
|
|
|
107
108
|
// Return the color as an rgba string
|
|
108
109
|
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
@@ -145,15 +146,15 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
145
146
|
}}
|
|
146
147
|
className={twMerge(
|
|
147
148
|
// makeBarListClassName('root'),
|
|
148
|
-
'flex justify-between',
|
|
149
|
-
'space-x-6',
|
|
149
|
+
'qq-flex qq-justify-between',
|
|
150
|
+
'qq-space-x-6',
|
|
150
151
|
className
|
|
151
152
|
)}
|
|
152
153
|
{...other}
|
|
153
154
|
>
|
|
154
155
|
<div
|
|
155
156
|
// className={twMerge(makeBarListClassName('bars'), 'relative w-full')}
|
|
156
|
-
className="relative-w-full
|
|
157
|
+
className="qq-relative-w-full"
|
|
157
158
|
style={{ width: '100%' }}
|
|
158
159
|
>
|
|
159
160
|
{data.slice(0, Math.floor(NUM_TO_SHOW / 2)).map((item, idx) => {
|
|
@@ -162,7 +163,7 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
162
163
|
|
|
163
164
|
return (
|
|
164
165
|
<div
|
|
165
|
-
className="flex flex-row items-center"
|
|
166
|
+
className="qq-flex qq-flex-row qq-items-center"
|
|
166
167
|
key={item[xAxisField] + idx}
|
|
167
168
|
>
|
|
168
169
|
<div
|
|
@@ -172,17 +173,17 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
172
173
|
<p
|
|
173
174
|
className={twMerge(
|
|
174
175
|
// makeBarListClassName('barText'),
|
|
175
|
-
'whitespace-nowrap truncate',
|
|
176
|
-
'text-gray-500',
|
|
177
|
-
'text-sm'
|
|
176
|
+
'qq-whitespace-nowrap truncate',
|
|
177
|
+
'qq-text-gray-500',
|
|
178
|
+
'qq-text-sm'
|
|
178
179
|
)}
|
|
179
180
|
>
|
|
180
181
|
{item[xAxisField]}
|
|
181
182
|
</p>
|
|
182
183
|
</div>
|
|
183
|
-
<div style={{ width: '100%' }} className="flex flex-col">
|
|
184
|
+
<div style={{ width: '100%' }} className="qq-flex qq-flex-col">
|
|
184
185
|
<div
|
|
185
|
-
className={`flex items-center h-9 rounded mb-2`}
|
|
186
|
+
className={`qq-flex qq-items-center qq-h-9 qq-rounded qq-mb-2`}
|
|
186
187
|
style={{
|
|
187
188
|
width: `${widths[idx]}%`,
|
|
188
189
|
transition: showAnimation ? 'all 2s' : '',
|
|
@@ -190,14 +191,17 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
190
191
|
}}
|
|
191
192
|
>
|
|
192
193
|
<div
|
|
193
|
-
className={twMerge(
|
|
194
|
+
className={twMerge(
|
|
195
|
+
'qq-absolute qq-max-w-full qq-flex',
|
|
196
|
+
'qq-ml-2'
|
|
197
|
+
)}
|
|
194
198
|
>
|
|
195
199
|
<p
|
|
196
200
|
className={twMerge(
|
|
197
201
|
// makeBarListClassName('barText'),
|
|
198
|
-
'whitespace-nowrap truncate',
|
|
199
|
-
'text-gray-500',
|
|
200
|
-
'text-sm'
|
|
202
|
+
'qq-whitespace-nowrap truncate',
|
|
203
|
+
'qq-text-gray-500',
|
|
204
|
+
'qq-text-sm'
|
|
201
205
|
)}
|
|
202
206
|
>
|
|
203
207
|
{yAxisFields[0].label}
|
|
@@ -205,7 +209,7 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
205
209
|
</div>
|
|
206
210
|
</div>
|
|
207
211
|
<div
|
|
208
|
-
className={`flex items-center h-9 rounded mb-2`}
|
|
212
|
+
className={`qq-flex qq-items-center qq-h-9 qq-rounded qq-mb-2`}
|
|
209
213
|
style={{
|
|
210
214
|
width: `${widths2[idx]}%`,
|
|
211
215
|
transition: showAnimation ? 'all 2s' : '',
|
|
@@ -213,14 +217,17 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
213
217
|
}}
|
|
214
218
|
>
|
|
215
219
|
<div
|
|
216
|
-
className={twMerge(
|
|
220
|
+
className={twMerge(
|
|
221
|
+
'qq-absolute qq-max-w-full qq-flex',
|
|
222
|
+
'qq-ml-2'
|
|
223
|
+
)}
|
|
217
224
|
>
|
|
218
225
|
<p
|
|
219
226
|
className={twMerge(
|
|
220
227
|
// makeBarListClassName('barText'),
|
|
221
|
-
'whitespace-nowrap truncate',
|
|
222
|
-
'text-gray-500',
|
|
223
|
-
'text-sm'
|
|
228
|
+
'qq-whitespace-nowrap truncate',
|
|
229
|
+
'qq-text-gray-500',
|
|
230
|
+
'qq-text-sm'
|
|
224
231
|
)}
|
|
225
232
|
>
|
|
226
233
|
{yAxisFields[1].label}
|
|
@@ -233,31 +240,36 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
233
240
|
);
|
|
234
241
|
})}
|
|
235
242
|
{data.length > NUM_TO_SHOW && (
|
|
236
|
-
<div
|
|
243
|
+
<div
|
|
244
|
+
style={{ color: theme.chartLabelColor }}
|
|
245
|
+
className="qq-text-sm"
|
|
246
|
+
>
|
|
237
247
|
...{data.length - NUM_TO_SHOW} more
|
|
238
248
|
</div>
|
|
239
249
|
)}
|
|
240
250
|
</div>
|
|
241
251
|
{/* eslint-disable prettier/prettier */}
|
|
242
252
|
<div
|
|
243
|
-
className={
|
|
253
|
+
className={
|
|
254
|
+
(makeBarListClassName('labels'), 'qq-text-right qq-min-w-min')
|
|
255
|
+
}
|
|
244
256
|
>
|
|
245
257
|
{data.slice(0, NUM_TO_SHOW).map((item, idx) => (
|
|
246
258
|
<div
|
|
247
259
|
key={item[xAxisField] + 'label' + idx}
|
|
248
260
|
className={twMerge(
|
|
249
261
|
makeBarListClassName('labelWrapper'),
|
|
250
|
-
'flex justify-end items-center',
|
|
251
|
-
'h-9',
|
|
252
|
-
idx === data.length - 1 ? 'mb-0' : 'mb-2'
|
|
262
|
+
'qq-flex qq-justify-end qq-items-center',
|
|
263
|
+
'qq-h-9',
|
|
264
|
+
idx === data.length - 1 ? 'qq-mb-0' : 'qq-mb-2'
|
|
253
265
|
)}
|
|
254
266
|
>
|
|
255
267
|
<p
|
|
256
268
|
className={twMerge(
|
|
257
269
|
makeBarListClassName('labelText'),
|
|
258
|
-
'whitespace-nowrap truncate',
|
|
259
|
-
'text-gray-500',
|
|
260
|
-
'text-sm'
|
|
270
|
+
'qq-whitespace-nowrap truncate',
|
|
271
|
+
'qq-text-gray-500',
|
|
272
|
+
'qq-text-sm'
|
|
261
273
|
)}
|
|
262
274
|
>
|
|
263
275
|
{valueFormatter(item[yAxisFields[0].field])}
|
|
@@ -282,15 +294,15 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
282
294
|
}}
|
|
283
295
|
className={twMerge(
|
|
284
296
|
// makeBarListClassName('root'),
|
|
285
|
-
'flex justify-between',
|
|
286
|
-
'space-x-6',
|
|
297
|
+
'qq-flex qq-justify-between',
|
|
298
|
+
'qq-space-x-6',
|
|
287
299
|
className
|
|
288
300
|
)}
|
|
289
301
|
{...other}
|
|
290
302
|
>
|
|
291
303
|
<div
|
|
292
304
|
// className={twMerge(makeBarListClassName('bars'), 'relative w-full')}
|
|
293
|
-
className="relative-w-full
|
|
305
|
+
className="qq-relative-w-full"
|
|
294
306
|
style={{ width: '100%' }}
|
|
295
307
|
>
|
|
296
308
|
{data.slice(0, NUM_TO_SHOW).map((item, idx) => {
|
|
@@ -300,20 +312,25 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
300
312
|
return (
|
|
301
313
|
<div
|
|
302
314
|
key={item[xAxisField] + 'label' + idx}
|
|
303
|
-
className={`flex items-center h-9 rounded mb-2`}
|
|
315
|
+
className={`qq-flex qq-items-center qq-h-9 qq-rounded qq-mb-2`}
|
|
304
316
|
style={{
|
|
305
317
|
width: `${widths[idx]}%`,
|
|
306
318
|
transition: showAnimation ? 'all 2s' : '',
|
|
307
319
|
backgroundColor: hexToRgbaWith10PercentAlpha(colors[0]),
|
|
308
320
|
}}
|
|
309
321
|
>
|
|
310
|
-
<div
|
|
322
|
+
<div
|
|
323
|
+
className={twMerge(
|
|
324
|
+
'qq-absolute qq-max-w-full qq-flex',
|
|
325
|
+
'qq-ml-2'
|
|
326
|
+
)}
|
|
327
|
+
>
|
|
311
328
|
<p
|
|
312
329
|
className={twMerge(
|
|
313
330
|
// makeBarListClassName('barText'),
|
|
314
|
-
'whitespace-nowrap truncate',
|
|
315
|
-
'text-gray-500',
|
|
316
|
-
'text-sm'
|
|
331
|
+
'qq-whitespace-nowrap truncate',
|
|
332
|
+
'qq-text-gray-500',
|
|
333
|
+
'qq-text-sm'
|
|
317
334
|
)}
|
|
318
335
|
>
|
|
319
336
|
{item[xAxisField]}
|
|
@@ -323,29 +340,33 @@ const BarList = React.forwardRef<HTMLDivElement, BarListProps>((props, ref) => {
|
|
|
323
340
|
);
|
|
324
341
|
})}
|
|
325
342
|
{data.length > NUM_TO_SHOW && (
|
|
326
|
-
<div style={{ color: theme.chartLabelColor }} className="text-sm">
|
|
343
|
+
<div style={{ color: theme.chartLabelColor }} className="qq-text-sm">
|
|
327
344
|
...{data.length - NUM_TO_SHOW} more
|
|
328
345
|
</div>
|
|
329
346
|
)}
|
|
330
347
|
</div>
|
|
331
348
|
{/* eslint-disable prettier/prettier */}
|
|
332
|
-
<div
|
|
349
|
+
<div
|
|
350
|
+
className={
|
|
351
|
+
(makeBarListClassName('labels'), 'qq-text-right qq-min-w-min')
|
|
352
|
+
}
|
|
353
|
+
>
|
|
333
354
|
{data.slice(0, NUM_TO_SHOW).map((item, idx) => (
|
|
334
355
|
<div
|
|
335
356
|
key={item[xAxisField] + 'value' + idx}
|
|
336
357
|
className={twMerge(
|
|
337
358
|
makeBarListClassName('labelWrapper'),
|
|
338
|
-
'flex justify-end items-center',
|
|
339
|
-
'h-9',
|
|
340
|
-
idx === data.length - 1 ? 'mb-0' : 'mb-2'
|
|
359
|
+
'qq-flex qq-justify-end qq-items-center',
|
|
360
|
+
'qq-h-9',
|
|
361
|
+
idx === data.length - 1 ? 'qq-mb-0' : 'qq-mb-2'
|
|
341
362
|
)}
|
|
342
363
|
>
|
|
343
364
|
<p
|
|
344
365
|
className={twMerge(
|
|
345
366
|
makeBarListClassName('labelText'),
|
|
346
|
-
'whitespace-nowrap truncate',
|
|
347
|
-
'text-gray-500',
|
|
348
|
-
'text-sm'
|
|
367
|
+
'qq-whitespace-nowrap qq-truncate',
|
|
368
|
+
'qq-text-gray-500',
|
|
369
|
+
'qq-text-sm'
|
|
349
370
|
)}
|
|
350
371
|
>
|
|
351
372
|
{valueFormatter(item[yAxisFields[0].field])}
|
package/src/Chart.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
//
|
|
3
|
-
|
|
2
|
+
// @ts-nocheck
|
|
4
3
|
import React, { useState, useEffect, useContext } from 'react';
|
|
5
4
|
import { twMerge } from 'tailwind-merge';
|
|
6
5
|
import {
|
|
@@ -204,7 +203,7 @@ export const ChartTooltipFrame = ({
|
|
|
204
203
|
children: React.ReactNode;
|
|
205
204
|
}) => (
|
|
206
205
|
<div
|
|
207
|
-
className="bg-white text-sm rounded-md border shadow-lg"
|
|
206
|
+
className="qq-bg-white qq-text-sm qq-rounded-md qq-border qq-shadow-lg"
|
|
208
207
|
// className={twMerge(
|
|
209
208
|
// 'bg-white',
|
|
210
209
|
// 'font-normal',
|
|
@@ -229,8 +228,8 @@ export const ChartTooltipRow = ({
|
|
|
229
228
|
name,
|
|
230
229
|
color,
|
|
231
230
|
}: ChartTooltipRowProps) => (
|
|
232
|
-
<div className="flex items-center justify-between space-x-8">
|
|
233
|
-
<div className="flex items-center space-x-2">
|
|
231
|
+
<div className="qq-flex qq-items-center qq-justify-between qq-space-x-8">
|
|
232
|
+
<div className="qq-flex qq-items-center qq-space-x-2">
|
|
234
233
|
<span
|
|
235
234
|
style={{ background: color, borderWidth: 2, borderColor: 'white' }}
|
|
236
235
|
className={twMerge(
|
|
@@ -240,10 +239,10 @@ export const ChartTooltipRow = ({
|
|
|
240
239
|
// 'border-black',
|
|
241
240
|
// sizing.sm.height,
|
|
242
241
|
// sizing.sm.width,
|
|
243
|
-
'h-3',
|
|
244
|
-
'w-3',
|
|
245
|
-
'shadow',
|
|
246
|
-
'rounded-full'
|
|
242
|
+
'qq-h-3',
|
|
243
|
+
'qq-w-3',
|
|
244
|
+
'qq-shadow',
|
|
245
|
+
'qq-rounded-full'
|
|
247
246
|
// border.md.all,
|
|
248
247
|
// boxShadow.md
|
|
249
248
|
)}
|
|
@@ -253,16 +252,16 @@ export const ChartTooltipRow = ({
|
|
|
253
252
|
// 'font-medium tabular-nums text-right whitespace-nowrap',
|
|
254
253
|
// 'text-[#212121] !important'
|
|
255
254
|
// )}
|
|
256
|
-
className="font-medium tabular-nums text-right whitespace-nowrap text-black"
|
|
255
|
+
className="qq-font-medium qq-tabular-nums qq-text-right qq-whitespace-nowrap qq-text-black"
|
|
257
256
|
>
|
|
258
257
|
{value}
|
|
259
258
|
</p>
|
|
260
259
|
</div>
|
|
261
260
|
<p
|
|
262
261
|
className={twMerge(
|
|
263
|
-
'text-right whitespace-nowrap',
|
|
262
|
+
'qq-text-right qq-whitespace-nowrap',
|
|
264
263
|
// getColorClassNames(DEFAULT_COLOR, colorPalette.text).textColor,
|
|
265
|
-
'text-gray-500'
|
|
264
|
+
'qq-text-gray-500'
|
|
266
265
|
// fontWeight.sm
|
|
267
266
|
)}
|
|
268
267
|
>
|
|
@@ -290,7 +289,7 @@ const ChartTooltip = ({
|
|
|
290
289
|
return (
|
|
291
290
|
<ChartTooltipFrame>
|
|
292
291
|
<div
|
|
293
|
-
className="flex flex-col py-2 px-4 border-b gray-200"
|
|
292
|
+
className="qq-flex qq-flex-col qq-py-2 qq-px-4 qq-border-b qq-gray-200"
|
|
294
293
|
// className={
|
|
295
294
|
// twMerge()
|
|
296
295
|
// getColorClassNames(DEFAULT_COLOR, colorPalette.lightBorder)
|
|
@@ -303,10 +302,10 @@ const ChartTooltip = ({
|
|
|
303
302
|
<p
|
|
304
303
|
style={{ textAlign: 'left' }}
|
|
305
304
|
className={twMerge(
|
|
306
|
-
'text-elem',
|
|
307
|
-
'text-black',
|
|
308
|
-
'font-medium',
|
|
309
|
-
'gray-700'
|
|
305
|
+
'qq-text-elem',
|
|
306
|
+
'qq-text-black',
|
|
307
|
+
'qq-font-medium',
|
|
308
|
+
'qq-gray-700'
|
|
310
309
|
// getColorClassNames(DEFAULT_COLOR, colorPalette.darkText)
|
|
311
310
|
// .textColor,
|
|
312
311
|
// fontWeight.md
|
|
@@ -320,7 +319,7 @@ const ChartTooltip = ({
|
|
|
320
319
|
</div>
|
|
321
320
|
|
|
322
321
|
<div
|
|
323
|
-
className="px-4 space-y-1 py-2 px-4"
|
|
322
|
+
className="qq-px-4 qq-space-y-1 qq-py-2 qq-px-4"
|
|
324
323
|
// className={
|
|
325
324
|
// twMerge()
|
|
326
325
|
// spacing.twoXl.paddingX,
|
|
@@ -613,7 +612,7 @@ const ChartUpdater: React.FC<ChartProps> = ({
|
|
|
613
612
|
height: '100%',
|
|
614
613
|
// background: 'red',
|
|
615
614
|
}}
|
|
616
|
-
className="flex flex-col text-xl"
|
|
615
|
+
className="qq-flex qq-flex-col qq-text-xl"
|
|
617
616
|
>
|
|
618
617
|
{formatNumber(
|
|
619
618
|
chartConfig.rows[0][chartConfig.xAxisField],
|
|
@@ -720,7 +719,10 @@ function BarChart({
|
|
|
720
719
|
}) {
|
|
721
720
|
const newColors = findComplementaryAndAnalogousColors(colors[0], colors[1]);
|
|
722
721
|
return (
|
|
723
|
-
<div
|
|
722
|
+
<div
|
|
723
|
+
style={containerStyle}
|
|
724
|
+
className="qq-flex qq-flex-col qq-flex-1 qq-h-full qq-w-full"
|
|
725
|
+
>
|
|
724
726
|
<ResponsiveContainer width="100%" height={'100%'}>
|
|
725
727
|
<ReChartsBarChart
|
|
726
728
|
data={data}
|
|
@@ -856,7 +858,10 @@ function LineChart({
|
|
|
856
858
|
return null;
|
|
857
859
|
}
|
|
858
860
|
return (
|
|
859
|
-
<div
|
|
861
|
+
<div
|
|
862
|
+
style={containerStyle}
|
|
863
|
+
className="qq-flex qq-flex-col qq-flex-1 qq-h-full qq-w-full"
|
|
864
|
+
>
|
|
860
865
|
<ResponsiveContainer width="100%" height={'100%'}>
|
|
861
866
|
<ReChartsAreaChart data={data}>
|
|
862
867
|
<CartesianGrid
|
package/src/Context.tsx
CHANGED
package/src/Dashboard.tsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import React, { useContext, useEffect, useState } from 'react';
|
|
2
3
|
import Chart from './Chart';
|
|
3
4
|
import {
|
|
4
5
|
ClientContext,
|
|
5
6
|
DashboardContext,
|
|
6
|
-
DashboardStateContext,
|
|
7
|
-
DashboardUpdateContext,
|
|
8
7
|
DateFilterContext,
|
|
9
8
|
ThemeContext,
|
|
10
9
|
} from './Context';
|
|
@@ -177,7 +176,7 @@ export default function Dashboard({
|
|
|
177
176
|
onClick={() => handleOnClickDashboardItem(elem._id)}
|
|
178
177
|
className={
|
|
179
178
|
onClickDashboardItem
|
|
180
|
-
? 'hover:bg-zinc-50'
|
|
179
|
+
? 'hover:qq-bg-zinc-50'
|
|
181
180
|
: undefined
|
|
182
181
|
}
|
|
183
182
|
key={elem.name + '' + index}
|
|
@@ -333,13 +332,13 @@ export default function Dashboard({
|
|
|
333
332
|
}
|
|
334
333
|
className={
|
|
335
334
|
onClickDashboardItem
|
|
336
|
-
? 'hover:bg-zinc-50'
|
|
335
|
+
? 'hover:qq-bg-zinc-50'
|
|
337
336
|
: undefined
|
|
338
337
|
}
|
|
339
|
-
// className="shadow-md"
|
|
338
|
+
// className="qq-shadow-md"
|
|
340
339
|
key={elem.name + '' + index}
|
|
341
340
|
// onClick={() => handleEditDashboardItem(elem)}
|
|
342
|
-
// className="shadow"
|
|
341
|
+
// className="qq-shadow"
|
|
343
342
|
style={{
|
|
344
343
|
// background: theme.elevatedCardColor,
|
|
345
344
|
// borderRadius: theme.borderRadius,
|
|
@@ -87,7 +87,7 @@ const CalendarHeader = ({
|
|
|
87
87
|
<div
|
|
88
88
|
className={twMerge(
|
|
89
89
|
makeDateRangePickerClassName('calendarHeader'),
|
|
90
|
-
'flex justify-between items-center',
|
|
90
|
+
'qq-flex qq-justify-between qq-items-center',
|
|
91
91
|
spacing.twoXs.paddingX,
|
|
92
92
|
spacing.sm.paddingY
|
|
93
93
|
)}
|
|
@@ -95,15 +95,15 @@ const CalendarHeader = ({
|
|
|
95
95
|
<div
|
|
96
96
|
className={twMerge(
|
|
97
97
|
makeDateRangePickerClassName('calendarHeaderPrevSelection'),
|
|
98
|
-
'flex items-center space-x-1'
|
|
98
|
+
'qq-flex qq-items-center qq-space-x-1'
|
|
99
99
|
)}
|
|
100
100
|
>
|
|
101
101
|
<button
|
|
102
102
|
type="button"
|
|
103
103
|
className={twMerge(
|
|
104
104
|
makeDateRangePickerClassName('calendarHeaderPrevYearButton'),
|
|
105
|
-
'inline-flex focus:outline-none focus:ring-2',
|
|
106
|
-
!enableYearPagination && 'hidden',
|
|
105
|
+
'qq-inline-flex focus:qq-outline-none focus:qq-ring-2',
|
|
106
|
+
!enableYearPagination && 'qq-hidden',
|
|
107
107
|
getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
108
108
|
.hoverBgColor,
|
|
109
109
|
getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor,
|
|
@@ -134,7 +134,7 @@ const CalendarHeader = ({
|
|
|
134
134
|
name="prevMonth"
|
|
135
135
|
className={twMerge(
|
|
136
136
|
makeDateRangePickerClassName('calendarHeaderPrevMonthButton'),
|
|
137
|
-
'inline-flex focus:outline-none focus:ring-2',
|
|
137
|
+
'qq-inline-flex focus:qq-outline-none focus:qq-ring-2',
|
|
138
138
|
getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
139
139
|
.hoverBgColor,
|
|
140
140
|
getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor,
|
|
@@ -163,7 +163,7 @@ const CalendarHeader = ({
|
|
|
163
163
|
<h2
|
|
164
164
|
className={twMerge(
|
|
165
165
|
makeDateRangePickerClassName('calendarHeaderText'),
|
|
166
|
-
'text-elem',
|
|
166
|
+
'qq-text-elem',
|
|
167
167
|
getColorClassNames(DEFAULT_COLOR, colorPalette.darkestText).textColor,
|
|
168
168
|
fontSize.sm,
|
|
169
169
|
fontWeight.lg
|
|
@@ -174,7 +174,7 @@ const CalendarHeader = ({
|
|
|
174
174
|
<div
|
|
175
175
|
className={twMerge(
|
|
176
176
|
makeDateRangePickerClassName('calendarHeaderNextSelection'),
|
|
177
|
-
'flex items-center space-x-1'
|
|
177
|
+
'qq-flex qq-items-center qq-space-x-1'
|
|
178
178
|
)}
|
|
179
179
|
>
|
|
180
180
|
<button
|
|
@@ -182,7 +182,7 @@ const CalendarHeader = ({
|
|
|
182
182
|
name="nextMonth"
|
|
183
183
|
className={twMerge(
|
|
184
184
|
makeDateRangePickerClassName('calendarHeaderNextMonthButton'),
|
|
185
|
-
'inline-flex focus:outline-none focus:ring-2',
|
|
185
|
+
'qq-inline-flex focus:qq-outline-none focus:qq-ring-2',
|
|
186
186
|
getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
187
187
|
.hoverBgColor,
|
|
188
188
|
getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor,
|
|
@@ -211,7 +211,7 @@ const CalendarHeader = ({
|
|
|
211
211
|
type="button"
|
|
212
212
|
className={twMerge(
|
|
213
213
|
makeDateRangePickerClassName('calendarHeaderNextYearButton'),
|
|
214
|
-
'inline-flex focus:outline-none focus:ring-2',
|
|
214
|
+
'qq-inline-flex focus:qq-outline-none focus:qq-ring-2',
|
|
215
215
|
!enableYearPagination && 'hidden',
|
|
216
216
|
getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
217
217
|
.hoverBgColor,
|
|
@@ -230,7 +230,7 @@ const CalendarHeader = ({
|
|
|
230
230
|
<DoubleArrowRightHeadIcon
|
|
231
231
|
className={twMerge(
|
|
232
232
|
makeDateRangePickerClassName('calendarHeaderNextYearIcon'),
|
|
233
|
-
'shrink-0 flex-0',
|
|
233
|
+
'qq-shrink-0 qq-flex-0',
|
|
234
234
|
getColorClassNames(DEFAULT_COLOR, colorPalette.darkText)
|
|
235
235
|
.textColor,
|
|
236
236
|
sizing.lg.height,
|
|
@@ -303,17 +303,17 @@ const CalendarBody = ({
|
|
|
303
303
|
<div
|
|
304
304
|
className={twMerge(
|
|
305
305
|
makeDateRangePickerClassName('calendarBodyWeekdays'),
|
|
306
|
-
'grid grid-cols-7 text-center',
|
|
306
|
+
'qq-grid qq-grid-cols-7 qq-text-center',
|
|
307
307
|
getColorClassNames(DEFAULT_COLOR, colorPalette.ring).textColor,
|
|
308
308
|
fontSize.xs,
|
|
309
309
|
fontWeight.md
|
|
310
310
|
)}
|
|
311
311
|
>
|
|
312
312
|
{weekdays.map(dayName => (
|
|
313
|
-
<div key={dayName} className="w-full flex justify-center">
|
|
313
|
+
<div key={dayName} className="qq-w-full qq-flex qq-justify-center">
|
|
314
314
|
<div
|
|
315
315
|
className={twMerge(
|
|
316
|
-
'flex items-center justify-center w-full',
|
|
316
|
+
'qq-flex qq-items-center qq-justify-center qq-w-full',
|
|
317
317
|
sizing.threeXl.height
|
|
318
318
|
)}
|
|
319
319
|
>
|
|
@@ -325,7 +325,7 @@ const CalendarBody = ({
|
|
|
325
325
|
<div
|
|
326
326
|
className={twMerge(
|
|
327
327
|
makeDateRangePickerClassName('calendarBodyDatesGrid'),
|
|
328
|
-
'grid grid-cols-7'
|
|
328
|
+
'qq-grid qq-grid-cols-7'
|
|
329
329
|
)}
|
|
330
330
|
>
|
|
331
331
|
{displayedDates.map(date => {
|
|
@@ -343,7 +343,7 @@ const CalendarBody = ({
|
|
|
343
343
|
className={twMerge(
|
|
344
344
|
makeDateRangePickerClassName('calendarBodyDate'),
|
|
345
345
|
colStartClasses[getDay(date)],
|
|
346
|
-
'w-full'
|
|
346
|
+
'qq-w-full'
|
|
347
347
|
)}
|
|
348
348
|
>
|
|
349
349
|
<button
|
|
@@ -352,7 +352,7 @@ const CalendarBody = ({
|
|
|
352
352
|
onPointerEnter={() => setHoveredDate?.(date)}
|
|
353
353
|
onPointerLeave={() => setHoveredDate?.(undefined)}
|
|
354
354
|
className={twMerge(
|
|
355
|
-
'w-full flex items-center justify-center',
|
|
355
|
+
'qq-w-full qq-flex qq-items-center qq-justify-center',
|
|
356
356
|
sizing.threeXl.height,
|
|
357
357
|
fontSize.sm,
|
|
358
358
|
getDateStyles(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react/display-name */
|
|
2
|
+
// @ts-nocheck
|
|
2
3
|
import React, { useRef, useState } from 'react';
|
|
3
4
|
import { twMerge } from 'tailwind-merge';
|
|
4
5
|
|
|
@@ -174,7 +175,7 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
|
174
175
|
ref={ref}
|
|
175
176
|
className={twMerge(
|
|
176
177
|
makeDateRangePickerClassName('root'),
|
|
177
|
-
'relative w-full',
|
|
178
|
+
'qq-relative qq-w-full',
|
|
178
179
|
className
|
|
179
180
|
)}
|
|
180
181
|
{...other}
|
|
@@ -203,7 +204,7 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
|
|
|
203
204
|
setShowModal={setShowCalendar}
|
|
204
205
|
parentRef={calendarRef}
|
|
205
206
|
width={288}
|
|
206
|
-
maxHeight="max-h-fit"
|
|
207
|
+
maxHeight="qq-max-h-fit"
|
|
207
208
|
>
|
|
208
209
|
<Calendar
|
|
209
210
|
enableYearPagination={enableYearPagination}
|