@quillsql/react 1.0.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/.eslintrc.json +19 -0
- package/.prettierrc +11 -0
- package/example/README.md +46 -0
- package/example/package-lock.json +12111 -0
- package/example/package.json +43 -0
- package/example/public/favicon.ico +0 -0
- package/example/public/index.html +43 -0
- package/example/public/logo192.png +0 -0
- package/example/public/logo512.png +0 -0
- package/example/public/manifest.json +25 -0
- package/example/public/robots.txt +3 -0
- package/example/src/App.css +38 -0
- package/example/src/App.test.tsx +9 -0
- package/example/src/App.tsx +46 -0
- package/example/src/index.css +13 -0
- package/example/src/index.tsx +19 -0
- package/example/src/logo.svg +1 -0
- package/example/src/react-app-env.d.ts +1 -0
- package/example/src/reportWebVitals.ts +15 -0
- package/example/src/setupTests.ts +5 -0
- package/example/tsconfig.json +26 -0
- package/lib/AppContext.d.ts +29 -0
- package/lib/AppContext.js +94 -0
- package/lib/AppContext.js.map +1 -0
- package/lib/BarList.d.ts +17 -0
- package/lib/BarList.js +81 -0
- package/lib/BarList.js.map +1 -0
- package/lib/Button.d.ts +26 -0
- package/lib/Button.js +151 -0
- package/lib/Button.js.map +1 -0
- package/lib/Chart.d.ts +26 -0
- package/lib/Chart.js +532 -0
- package/lib/Chart.js.map +1 -0
- package/lib/Context.d.ts +28 -0
- package/lib/Context.js +126 -0
- package/lib/Context.js.map +1 -0
- package/lib/ContextProvider.d.ts +28 -0
- package/lib/ContextProvider.js +93 -0
- package/lib/ContextProvider.js.map +1 -0
- package/lib/Dashboard.d.ts +9 -0
- package/lib/Dashboard.js +271 -0
- package/lib/Dashboard.js.map +1 -0
- package/lib/DateRangePicker/Calendar.d.ts +15 -0
- package/lib/DateRangePicker/Calendar.js +94 -0
- package/lib/DateRangePicker/Calendar.js.map +1 -0
- package/lib/DateRangePicker/DateRangePicker.d.ts +31 -0
- package/lib/DateRangePicker/DateRangePicker.js +105 -0
- package/lib/DateRangePicker/DateRangePicker.js.map +1 -0
- package/lib/DateRangePicker/DateRangePickerButton.d.ts +21 -0
- package/lib/DateRangePicker/DateRangePickerButton.js +39 -0
- package/lib/DateRangePicker/DateRangePickerButton.js.map +1 -0
- package/lib/DateRangePicker/dateRangePickerUtils.d.ts +13 -0
- package/lib/DateRangePicker/dateRangePickerUtils.js +313 -0
- package/lib/DateRangePicker/dateRangePickerUtils.js.map +1 -0
- package/lib/DateRangePicker/index.d.ts +2 -0
- package/lib/DateRangePicker/index.js +2 -0
- package/lib/DateRangePicker/index.js.map +1 -0
- package/lib/DateRangePicker.d.ts +32 -0
- package/lib/DateRangePicker.js +105 -0
- package/lib/DateRangePicker.js.map +1 -0
- package/lib/PieChart.d.ts +63 -0
- package/lib/PieChart.js +589 -0
- package/lib/PieChart.js.map +1 -0
- package/lib/QuillProvider.d.ts +13 -0
- package/lib/QuillProvider.js +19 -0
- package/lib/QuillProvider.js.map +1 -0
- package/lib/assets/ArrowDownHeadIcon.d.ts +5 -0
- package/lib/assets/ArrowDownHeadIcon.js +29 -0
- package/lib/assets/ArrowDownHeadIcon.js.map +1 -0
- package/lib/assets/ArrowDownIcon.d.ts +5 -0
- package/lib/assets/ArrowDownIcon.js +29 -0
- package/lib/assets/ArrowDownIcon.js.map +1 -0
- package/lib/assets/ArrowDownRightIcon.d.ts +5 -0
- package/lib/assets/ArrowDownRightIcon.js +29 -0
- package/lib/assets/ArrowDownRightIcon.js.map +1 -0
- package/lib/assets/ArrowLeftHeadIcon.d.ts +5 -0
- package/lib/assets/ArrowLeftHeadIcon.js +29 -0
- package/lib/assets/ArrowLeftHeadIcon.js.map +1 -0
- package/lib/assets/ArrowRightHeadIcon.d.ts +5 -0
- package/lib/assets/ArrowRightHeadIcon.js +29 -0
- package/lib/assets/ArrowRightHeadIcon.js.map +1 -0
- package/lib/assets/ArrowRightIcon.d.ts +5 -0
- package/lib/assets/ArrowRightIcon.js +29 -0
- package/lib/assets/ArrowRightIcon.js.map +1 -0
- package/lib/assets/ArrowUpHeadIcon.d.ts +5 -0
- package/lib/assets/ArrowUpHeadIcon.js +29 -0
- package/lib/assets/ArrowUpHeadIcon.js.map +1 -0
- package/lib/assets/ArrowUpIcon.d.ts +5 -0
- package/lib/assets/ArrowUpIcon.js +29 -0
- package/lib/assets/ArrowUpIcon.js.map +1 -0
- package/lib/assets/ArrowUpRightIcon.d.ts +5 -0
- package/lib/assets/ArrowUpRightIcon.js +29 -0
- package/lib/assets/ArrowUpRightIcon.js.map +1 -0
- package/lib/assets/CalendarIcon.d.ts +5 -0
- package/lib/assets/CalendarIcon.js +29 -0
- package/lib/assets/CalendarIcon.js.map +1 -0
- package/lib/assets/DoubleArrowLeftHeadIcon.d.ts +5 -0
- package/lib/assets/DoubleArrowLeftHeadIcon.js +29 -0
- package/lib/assets/DoubleArrowLeftHeadIcon.js.map +1 -0
- package/lib/assets/DoubleArrowRightHeadIcon.d.ts +5 -0
- package/lib/assets/DoubleArrowRightHeadIcon.js +29 -0
- package/lib/assets/DoubleArrowRightHeadIcon.js.map +1 -0
- package/lib/assets/ExclamationFilledIcon.d.ts +5 -0
- package/lib/assets/ExclamationFilledIcon.js +29 -0
- package/lib/assets/ExclamationFilledIcon.js.map +1 -0
- package/lib/assets/LoadingSpinner.d.ts +5 -0
- package/lib/assets/LoadingSpinner.js +29 -0
- package/lib/assets/LoadingSpinner.js.map +1 -0
- package/lib/assets/SearchIcon.d.ts +5 -0
- package/lib/assets/SearchIcon.js +29 -0
- package/lib/assets/SearchIcon.js.map +1 -0
- package/lib/assets/XCircleIcon.d.ts +5 -0
- package/lib/assets/XCircleIcon.js +29 -0
- package/lib/assets/XCircleIcon.js.map +1 -0
- package/lib/assets/index.d.ts +16 -0
- package/lib/assets/index.js +17 -0
- package/lib/assets/index.js.map +1 -0
- package/lib/components/Dropdown/Dropdown.d.ts +12 -0
- package/lib/components/Dropdown/Dropdown.js +60 -0
- package/lib/components/Dropdown/Dropdown.js.map +1 -0
- package/lib/components/Dropdown/DropdownItem.d.ts +8 -0
- package/lib/components/Dropdown/DropdownItem.js +54 -0
- package/lib/components/Dropdown/DropdownItem.js.map +1 -0
- package/lib/components/Dropdown/index.d.ts +2 -0
- package/lib/components/Dropdown/index.js +3 -0
- package/lib/components/Dropdown/index.js.map +1 -0
- package/lib/components/Modal/Dropdown/Dropdown.d.ts +12 -0
- package/lib/components/Modal/Dropdown/Dropdown.js +52 -0
- package/lib/components/Modal/Dropdown/Dropdown.js.map +1 -0
- package/lib/components/Modal/Dropdown/DropdownItem.d.ts +8 -0
- package/lib/components/Modal/Dropdown/DropdownItem.js +51 -0
- package/lib/components/Modal/Dropdown/DropdownItem.js.map +1 -0
- package/lib/components/Modal/Dropdown/index.d.ts +2 -0
- package/lib/components/Modal/Dropdown/index.js +3 -0
- package/lib/components/Modal/Dropdown/index.js.map +1 -0
- package/lib/components/Modal/Modal.d.ts +13 -0
- package/lib/components/Modal/Modal.js +71 -0
- package/lib/components/Modal/Modal.js.map +1 -0
- package/lib/components/Modal/index.d.ts +1 -0
- package/lib/components/Modal/index.js +2 -0
- package/lib/components/Modal/index.js.map +1 -0
- package/lib/components/selectUtils.d.ts +9 -0
- package/lib/components/selectUtils.js +37 -0
- package/lib/components/selectUtils.js.map +1 -0
- package/lib/contexts/BaseColorContext.d.ts +3 -0
- package/lib/contexts/BaseColorContext.js +5 -0
- package/lib/contexts/BaseColorContext.js.map +1 -0
- package/lib/contexts/HoveredValueContext.d.ts +7 -0
- package/lib/contexts/HoveredValueContext.js +6 -0
- package/lib/contexts/HoveredValueContext.js.map +1 -0
- package/lib/contexts/RootStylesContext.d.ts +3 -0
- package/lib/contexts/RootStylesContext.js +4 -0
- package/lib/contexts/RootStylesContext.js.map +1 -0
- package/lib/contexts/SelectedValueContext.d.ts +7 -0
- package/lib/contexts/SelectedValueContext.js +7 -0
- package/lib/contexts/SelectedValueContext.js.map +1 -0
- package/lib/contexts/index.d.ts +4 -0
- package/lib/contexts/index.js +5 -0
- package/lib/contexts/index.js.map +1 -0
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/index.js +5 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useInternalState.d.ts +3 -0
- package/lib/hooks/useInternalState.js +15 -0
- package/lib/hooks/useInternalState.js.map +1 -0
- package/lib/hooks/useOnClickOutside.d.ts +2 -0
- package/lib/hooks/useOnClickOutside.js +19 -0
- package/lib/hooks/useOnClickOutside.js.map +1 -0
- package/lib/hooks/useOnWindowResize.d.ts +4 -0
- package/lib/hooks/useOnWindowResize.js +15 -0
- package/lib/hooks/useOnWindowResize.js.map +1 -0
- package/lib/hooks/useSelectOnKeyDown.d.ts +2 -0
- package/lib/hooks/useSelectOnKeyDown.js +64 -0
- package/lib/hooks/useSelectOnKeyDown.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -0
- package/lib/lib/colorClassNames.d.ts +19 -0
- package/lib/lib/colorClassNames.js +3175 -0
- package/lib/lib/colorClassNames.js.map +1 -0
- package/lib/lib/constants.d.ts +16 -0
- package/lib/lib/constants.js +47 -0
- package/lib/lib/constants.js.map +1 -0
- package/lib/lib/font.d.ts +13 -0
- package/lib/lib/font.js +14 -0
- package/lib/lib/font.js.map +1 -0
- package/lib/lib/hexColors.d.ts +3 -0
- package/lib/lib/hexColors.js +29 -0
- package/lib/lib/hexColors.js.map +1 -0
- package/lib/lib/index.d.ts +10 -0
- package/lib/lib/index.js +11 -0
- package/lib/lib/index.js.map +1 -0
- package/lib/lib/inputTypes.d.ts +20 -0
- package/lib/lib/inputTypes.js +37 -0
- package/lib/lib/inputTypes.js.map +1 -0
- package/lib/lib/shape.d.ts +73 -0
- package/lib/lib/shape.js +74 -0
- package/lib/lib/shape.js.map +1 -0
- package/lib/lib/sizing.d.ts +46 -0
- package/lib/lib/sizing.js +43 -0
- package/lib/lib/sizing.js.map +1 -0
- package/lib/lib/spacing.d.ts +264 -0
- package/lib/lib/spacing.js +265 -0
- package/lib/lib/spacing.js.map +1 -0
- package/lib/lib/theme.d.ts +22 -0
- package/lib/lib/theme.js +46 -0
- package/lib/lib/theme.js.map +1 -0
- package/lib/lib/utils.d.ts +12 -0
- package/lib/lib/utils.js +69 -0
- package/lib/lib/utils.js.map +1 -0
- package/lib/styles.css +12019 -0
- package/package.json +48 -0
- package/postcss.config.js +6 -0
- package/src/BarList.tsx +236 -0
- package/src/Chart.tsx +934 -0
- package/src/Context.tsx +204 -0
- package/src/Dashboard.tsx +379 -0
- package/src/DateRangePicker/Calendar.tsx +425 -0
- package/src/DateRangePicker/DateRangePicker.tsx +251 -0
- package/src/DateRangePicker/DateRangePickerButton.tsx +176 -0
- package/src/DateRangePicker/dateRangePickerUtils.tsx +460 -0
- package/src/DateRangePicker/index.ts +3 -0
- package/src/PieChart.tsx +838 -0
- package/src/QuillProvider.tsx +28 -0
- package/src/assets/ArrowDownHeadIcon.tsx +11 -0
- package/src/assets/ArrowDownIcon.tsx +14 -0
- package/src/assets/ArrowDownRightIcon.tsx +14 -0
- package/src/assets/ArrowLeftHeadIcon.tsx +11 -0
- package/src/assets/ArrowRightHeadIcon.tsx +11 -0
- package/src/assets/ArrowRightIcon.tsx +14 -0
- package/src/assets/ArrowUpHeadIcon.tsx +11 -0
- package/src/assets/ArrowUpIcon.tsx +14 -0
- package/src/assets/ArrowUpRightIcon.tsx +14 -0
- package/src/assets/CalendarIcon.tsx +14 -0
- package/src/assets/DoubleArrowLeftHeadIcon.tsx +18 -0
- package/src/assets/DoubleArrowRightHeadIcon.tsx +20 -0
- package/src/assets/ExclamationFilledIcon.tsx +14 -0
- package/src/assets/LoadingSpinner.tsx +11 -0
- package/src/assets/SearchIcon.tsx +14 -0
- package/src/assets/XCircleIcon.tsx +14 -0
- package/src/assets/index.ts +16 -0
- package/src/components/Dropdown/Dropdown.tsx +179 -0
- package/src/components/Dropdown/DropdownItem.tsx +86 -0
- package/src/components/Dropdown/index.ts +2 -0
- package/src/components/Modal/Modal.tsx +113 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/selectUtils.ts +67 -0
- package/src/contexts/BaseColorContext.tsx +8 -0
- package/src/contexts/HoveredValueContext.tsx +12 -0
- package/src/contexts/RootStylesContext.tsx +5 -0
- package/src/contexts/SelectedValueContext.tsx +13 -0
- package/src/contexts/index.ts +4 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useInternalState.tsx +18 -0
- package/src/hooks/useOnClickOutside.tsx +23 -0
- package/src/hooks/useOnWindowResize.tsx +17 -0
- package/src/hooks/useSelectOnKeyDown.tsx +80 -0
- package/src/index.ts +4 -0
- package/src/lib/colorClassNames.ts +3191 -0
- package/src/lib/constants.ts +52 -0
- package/src/lib/font.ts +14 -0
- package/src/lib/hexColors.ts +28 -0
- package/src/lib/index.ts +10 -0
- package/src/lib/inputTypes.ts +62 -0
- package/src/lib/shape.ts +75 -0
- package/src/lib/sizing.ts +47 -0
- package/src/lib/spacing.ts +264 -0
- package/src/lib/theme.ts +49 -0
- package/src/lib/utils.tsx +81 -0
- package/src/styles.css +5 -0
- package/tailwind.config.js +16 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "example",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
7
|
+
"@testing-library/react": "^13.4.0",
|
|
8
|
+
"@testing-library/user-event": "^13.5.0",
|
|
9
|
+
"@types/jest": "^27.5.2",
|
|
10
|
+
"@types/node": "^16.18.23",
|
|
11
|
+
"@types/react": "^18.0.33",
|
|
12
|
+
"@types/react-dom": "^18.0.11",
|
|
13
|
+
"react": "^18.2.0",
|
|
14
|
+
"react-dom": "^18.2.0",
|
|
15
|
+
"react-scripts": "5.0.1",
|
|
16
|
+
"typescript": "^4.9.5",
|
|
17
|
+
"web-vitals": "^2.1.4"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"start": "react-scripts start",
|
|
21
|
+
"build": "react-scripts build",
|
|
22
|
+
"test": "react-scripts test",
|
|
23
|
+
"eject": "react-scripts eject"
|
|
24
|
+
},
|
|
25
|
+
"eslintConfig": {
|
|
26
|
+
"extends": [
|
|
27
|
+
"react-app",
|
|
28
|
+
"react-app/jest"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"browserslist": {
|
|
32
|
+
"production": [
|
|
33
|
+
">0.2%",
|
|
34
|
+
"not dead",
|
|
35
|
+
"not op_mini all"
|
|
36
|
+
],
|
|
37
|
+
"development": [
|
|
38
|
+
"last 1 chrome version",
|
|
39
|
+
"last 1 firefox version",
|
|
40
|
+
"last 1 safari version"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<meta name="theme-color" content="#000000" />
|
|
8
|
+
<meta
|
|
9
|
+
name="description"
|
|
10
|
+
content="Web site created using create-react-app"
|
|
11
|
+
/>
|
|
12
|
+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
|
13
|
+
<!--
|
|
14
|
+
manifest.json provides metadata used when your web app is installed on a
|
|
15
|
+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
16
|
+
-->
|
|
17
|
+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
18
|
+
<!--
|
|
19
|
+
Notice the use of %PUBLIC_URL% in the tags above.
|
|
20
|
+
It will be replaced with the URL of the `public` folder during the build.
|
|
21
|
+
Only files inside the `public` folder can be referenced from the HTML.
|
|
22
|
+
|
|
23
|
+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
|
24
|
+
work correctly both with client-side routing and a non-root public URL.
|
|
25
|
+
Learn how to configure a non-root public URL by running `npm run build`.
|
|
26
|
+
-->
|
|
27
|
+
<title>React App</title>
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
31
|
+
<div id="root"></div>
|
|
32
|
+
<!--
|
|
33
|
+
This HTML file is a template.
|
|
34
|
+
If you open it directly in the browser, you will see an empty page.
|
|
35
|
+
|
|
36
|
+
You can add webfonts, meta tags, or analytics to this file.
|
|
37
|
+
The build step will place the bundled scripts into the <body> tag.
|
|
38
|
+
|
|
39
|
+
To begin the development, run `npm start` or `yarn start`.
|
|
40
|
+
To create a production bundle, use `npm run build` or `yarn build`.
|
|
41
|
+
-->
|
|
42
|
+
</body>
|
|
43
|
+
</html>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"short_name": "React App",
|
|
3
|
+
"name": "Create React App Sample",
|
|
4
|
+
"icons": [
|
|
5
|
+
{
|
|
6
|
+
"src": "favicon.ico",
|
|
7
|
+
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
+
"type": "image/x-icon"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"src": "logo192.png",
|
|
12
|
+
"type": "image/png",
|
|
13
|
+
"sizes": "192x192"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"src": "logo512.png",
|
|
17
|
+
"type": "image/png",
|
|
18
|
+
"sizes": "512x512"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"start_url": ".",
|
|
22
|
+
"display": "standalone",
|
|
23
|
+
"theme_color": "#000000",
|
|
24
|
+
"background_color": "#ffffff"
|
|
25
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.App {
|
|
2
|
+
text-align: center;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.App-logo {
|
|
6
|
+
height: 40vmin;
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
11
|
+
.App-logo {
|
|
12
|
+
animation: App-logo-spin infinite 20s linear;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.App-header {
|
|
17
|
+
background-color: #ffffff;
|
|
18
|
+
min-height: 100vh;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
font-size: calc(10px + 2vmin);
|
|
24
|
+
color: white;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.App-link {
|
|
28
|
+
color: #61dafb;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@keyframes App-logo-spin {
|
|
32
|
+
from {
|
|
33
|
+
transform: rotate(0deg);
|
|
34
|
+
}
|
|
35
|
+
to {
|
|
36
|
+
transform: rotate(360deg);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import App from './App';
|
|
4
|
+
|
|
5
|
+
test('renders learn react link', () => {
|
|
6
|
+
render(<App />);
|
|
7
|
+
const linkElement = screen.getByText(/learn react/i);
|
|
8
|
+
expect(linkElement).toBeInTheDocument();
|
|
9
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Dashboard, QuillProvider } from '@quillsql/react';
|
|
3
|
+
import '@quillsql/react/lib/styles.css';
|
|
4
|
+
|
|
5
|
+
const theme = {
|
|
6
|
+
fontFamily: 'Inter; Helvetica',
|
|
7
|
+
primaryTextColor: '#212121',
|
|
8
|
+
secondaryTextColor: '#6C727F',
|
|
9
|
+
chartLabelColor: '#666666',
|
|
10
|
+
chartTickColor: '#CCCCCC',
|
|
11
|
+
chartColors: ['#6269E9', '#E14F62'],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function App() {
|
|
15
|
+
return (
|
|
16
|
+
<div
|
|
17
|
+
style={{
|
|
18
|
+
backgroundColor: '#ffffff',
|
|
19
|
+
minHeight: '100vh',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
flexDirection: 'column',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'center',
|
|
24
|
+
width: '100vw',
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
{/* @ts-ignore */}
|
|
28
|
+
<QuillProvider
|
|
29
|
+
organizationId="2"
|
|
30
|
+
publicKey="62cda15d7c9fcca7bc0a3689"
|
|
31
|
+
theme={theme}
|
|
32
|
+
>
|
|
33
|
+
<Dashboard
|
|
34
|
+
containerStyle={{
|
|
35
|
+
paddingLeft: 25,
|
|
36
|
+
paddingRight: 25,
|
|
37
|
+
paddingTop: 50,
|
|
38
|
+
width: '100%',
|
|
39
|
+
}}
|
|
40
|
+
/>
|
|
41
|
+
</QuillProvider>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default App;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
body {
|
|
2
|
+
margin: 0;
|
|
3
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
4
|
+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
5
|
+
sans-serif;
|
|
6
|
+
-webkit-font-smoothing: antialiased;
|
|
7
|
+
-moz-osx-font-smoothing: grayscale;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
code {
|
|
11
|
+
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
|
12
|
+
monospace;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
3
|
+
import './index.css';
|
|
4
|
+
import App from './App';
|
|
5
|
+
import reportWebVitals from './reportWebVitals';
|
|
6
|
+
|
|
7
|
+
const root = ReactDOM.createRoot(
|
|
8
|
+
document.getElementById('root') as HTMLElement
|
|
9
|
+
);
|
|
10
|
+
root.render(
|
|
11
|
+
<React.StrictMode>
|
|
12
|
+
<App />
|
|
13
|
+
</React.StrictMode>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
// If you want to start measuring performance in your app, pass a function
|
|
17
|
+
// to log results (for example: reportWebVitals(console.log))
|
|
18
|
+
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
|
19
|
+
reportWebVitals();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="react-scripts" />
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReportHandler } from 'web-vitals';
|
|
2
|
+
|
|
3
|
+
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
|
4
|
+
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
5
|
+
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
|
6
|
+
getCLS(onPerfEntry);
|
|
7
|
+
getFID(onPerfEntry);
|
|
8
|
+
getFCP(onPerfEntry);
|
|
9
|
+
getLCP(onPerfEntry);
|
|
10
|
+
getTTFB(onPerfEntry);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default reportWebVitals;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"lib": [
|
|
5
|
+
"dom",
|
|
6
|
+
"dom.iterable",
|
|
7
|
+
"esnext"
|
|
8
|
+
],
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"allowSyntheticDefaultImports": true,
|
|
13
|
+
"strict": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"noFallthroughCasesInSwitch": true,
|
|
16
|
+
"module": "esnext",
|
|
17
|
+
"moduleResolution": "node",
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"isolatedModules": true,
|
|
20
|
+
"noEmit": true,
|
|
21
|
+
"jsx": "react-jsx"
|
|
22
|
+
},
|
|
23
|
+
"include": [
|
|
24
|
+
"src"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const SchemaContext: React.Context<unknown>;
|
|
3
|
+
export declare const ColumnsContext: React.Context<unknown>;
|
|
4
|
+
export declare const RowsContext: React.Context<unknown>;
|
|
5
|
+
export declare const SelectedSidebarIndexContext: React.Context<unknown>;
|
|
6
|
+
export declare const HistoryContext: React.Context<unknown>;
|
|
7
|
+
export declare const SavedQueriesContext: React.Context<unknown>;
|
|
8
|
+
export declare const SaveQueryModalStatusContext: React.Context<unknown>;
|
|
9
|
+
export declare const EditorQueryContext: React.Context<unknown>;
|
|
10
|
+
export declare const ThemeContext: React.Context<unknown>;
|
|
11
|
+
export declare const ClientContext: React.Context<unknown>;
|
|
12
|
+
export declare const CreateVisualizationModalVisibleContext: React.Context<unknown>;
|
|
13
|
+
export declare const ActiveVisualizationContext: React.Context<unknown>;
|
|
14
|
+
export declare const QueryResultsLoadingContext: React.Context<unknown>;
|
|
15
|
+
export declare const EditVisualizationModalVisibleContext: React.Context<unknown>;
|
|
16
|
+
export declare const ReportBuilderQueryContext: React.Context<unknown>;
|
|
17
|
+
export declare const SavedReportsQueryContext: React.Context<unknown>;
|
|
18
|
+
export declare const DashboardUpdateContext: React.Context<unknown>;
|
|
19
|
+
export declare const DashboardStateContext: React.Context<unknown>;
|
|
20
|
+
export declare const ContextProvider: ({ children, containerStyle, initialTheme, publicKey, authToken, customerId, userId, }: {
|
|
21
|
+
children: any;
|
|
22
|
+
containerStyle: any;
|
|
23
|
+
initialTheme: any;
|
|
24
|
+
publicKey: any;
|
|
25
|
+
authToken: any;
|
|
26
|
+
customerId: any;
|
|
27
|
+
userId: any;
|
|
28
|
+
}) => JSX.Element | null;
|
|
29
|
+
export default ContextProvider;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import React, { useEffect, useState } from 'react';
|
|
14
|
+
export var SchemaContext = React.createContext();
|
|
15
|
+
export var ColumnsContext = React.createContext();
|
|
16
|
+
export var RowsContext = React.createContext();
|
|
17
|
+
export var SelectedSidebarIndexContext = React.createContext();
|
|
18
|
+
export var HistoryContext = React.createContext();
|
|
19
|
+
export var SavedQueriesContext = React.createContext();
|
|
20
|
+
export var SaveQueryModalStatusContext = React.createContext();
|
|
21
|
+
export var EditorQueryContext = React.createContext();
|
|
22
|
+
export var ThemeContext = React.createContext();
|
|
23
|
+
export var ClientContext = React.createContext();
|
|
24
|
+
export var CreateVisualizationModalVisibleContext = React.createContext();
|
|
25
|
+
export var ActiveVisualizationContext = React.createContext();
|
|
26
|
+
export var QueryResultsLoadingContext = React.createContext();
|
|
27
|
+
export var EditVisualizationModalVisibleContext = React.createContext();
|
|
28
|
+
export var ReportBuilderQueryContext = React.createContext();
|
|
29
|
+
export var SavedReportsQueryContext = React.createContext();
|
|
30
|
+
export var DashboardUpdateContext = React.createContext();
|
|
31
|
+
export var DashboardStateContext = React.createContext();
|
|
32
|
+
export var ContextProvider = function (_a) {
|
|
33
|
+
var children = _a.children, containerStyle = _a.containerStyle, initialTheme = _a.initialTheme, publicKey = _a.publicKey, authToken = _a.authToken, customerId = _a.customerId, userId = _a.userId;
|
|
34
|
+
var _b = useState(null), client = _b[0], setClient = _b[1];
|
|
35
|
+
var _c = useState(null), theme = _c[0], setTheme = _c[1];
|
|
36
|
+
var _d = useState(null), columns = _d[0], setColumns = _d[1];
|
|
37
|
+
var _e = useState(null), rows = _e[0], setRows = _e[1];
|
|
38
|
+
var _f = useState([]), schema = _f[0], setSchema = _f[1];
|
|
39
|
+
var _g = useState(0), selectedSidebarIndex = _g[0], setSelectedSidebarIndex = _g[1];
|
|
40
|
+
var _h = useState([]), history = _h[0], setHistory = _h[1];
|
|
41
|
+
var _j = useState([]), savedQueries = _j[0], setSavedQueries = _j[1];
|
|
42
|
+
// REPORT_BUILDER, SQL_EDITOR, HIDDEN
|
|
43
|
+
var _k = useState('HIDDEN'), saveQueryModalStatus = _k[0], setSaveQueryModalStatus = _k[1];
|
|
44
|
+
var _l = useState(''), editorQuery = _l[0], setEditorQuery = _l[1];
|
|
45
|
+
var _m = useState(''), savedReportsQuery = _m[0], setSavedReportsQuery = _m[1];
|
|
46
|
+
var _o = useState(''), reportBuilderQuery = _o[0], setReportBuilderQuery = _o[1];
|
|
47
|
+
var _p = useState(false), createVisualizationModalVisible = _p[0], setCreateVisualizationModalVisible = _p[1];
|
|
48
|
+
var _q = useState(null), activeVisualization = _q[0], setActiveVisualization = _q[1];
|
|
49
|
+
var _r = useState(false), queryResultsLoading = _r[0], setQueryResultsLoading = _r[1];
|
|
50
|
+
var _s = useState(false), editVisualizationModalVisible = _s[0], setEditVisualizationModalVisible = _s[1];
|
|
51
|
+
// SEPARATED INTO TWO CONTEXTS TO PREVENT RERENDER
|
|
52
|
+
var _t = useState({}), dashboard = _t[0], setDashboard = _t[1];
|
|
53
|
+
// SETS INITIAL THEME
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
if (!theme) {
|
|
56
|
+
setTheme(__assign(__assign({}, initialTheme), { containerStyle: containerStyle }));
|
|
57
|
+
}
|
|
58
|
+
}, [initialTheme, containerStyle]);
|
|
59
|
+
// SETS INITIAL CLIENT
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
if (!client) {
|
|
62
|
+
setClient({
|
|
63
|
+
customerId: customerId,
|
|
64
|
+
userId: userId,
|
|
65
|
+
authToken: authToken,
|
|
66
|
+
publicKey: publicKey,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}, [customerId, userId, authToken, publicKey, client]);
|
|
70
|
+
if (!theme || !client) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return (_jsx(ClientContext.Provider, __assign({ value: [client, setClient] }, { children: _jsx(ThemeContext.Provider, __assign({ value: [theme, setTheme] }, { children: _jsx(SchemaContext.Provider, __assign({ value: [schema, setSchema] }, { children: _jsx(ColumnsContext.Provider, __assign({ value: [columns, setColumns] }, { children: _jsx(RowsContext.Provider, __assign({ value: [rows, setRows] }, { children: _jsx(SelectedSidebarIndexContext.Provider, __assign({ value: [selectedSidebarIndex, setSelectedSidebarIndex] }, { children: _jsx(HistoryContext.Provider, __assign({ value: [history, setHistory] }, { children: _jsx(SavedQueriesContext.Provider, __assign({ value: [savedQueries, setSavedQueries] }, { children: _jsx(SaveQueryModalStatusContext.Provider, __assign({ value: [saveQueryModalStatus, setSaveQueryModalStatus] }, { children: _jsx(CreateVisualizationModalVisibleContext.Provider, __assign({ value: [
|
|
74
|
+
createVisualizationModalVisible,
|
|
75
|
+
setCreateVisualizationModalVisible,
|
|
76
|
+
] }, { children: _jsx(EditorQueryContext.Provider, __assign({ value: [editorQuery, setEditorQuery] }, { children: _jsx(ActiveVisualizationContext.Provider, __assign({ value: [
|
|
77
|
+
activeVisualization,
|
|
78
|
+
setActiveVisualization,
|
|
79
|
+
] }, { children: _jsx(QueryResultsLoadingContext.Provider, __assign({ value: [
|
|
80
|
+
queryResultsLoading,
|
|
81
|
+
setQueryResultsLoading,
|
|
82
|
+
] }, { children: _jsx(EditVisualizationModalVisibleContext.Provider, __assign({ value: [
|
|
83
|
+
editVisualizationModalVisible,
|
|
84
|
+
setEditVisualizationModalVisible,
|
|
85
|
+
] }, { children: _jsx(ReportBuilderQueryContext.Provider, __assign({ value: [
|
|
86
|
+
reportBuilderQuery,
|
|
87
|
+
setReportBuilderQuery,
|
|
88
|
+
] }, { children: _jsx(SavedReportsQueryContext.Provider, __assign({ value: [
|
|
89
|
+
savedReportsQuery,
|
|
90
|
+
setSavedReportsQuery,
|
|
91
|
+
] }, { children: _jsx(DashboardStateContext.Provider, __assign({ value: dashboard }, { children: _jsx(DashboardUpdateContext.Provider, __assign({ value: setDashboard }, { children: children })) })) })) })) })) })) })) })) })) })) })) })) })) })) })) })) })) })));
|
|
92
|
+
};
|
|
93
|
+
export default ContextProvider;
|
|
94
|
+
//# sourceMappingURL=AppContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppContext.js","sourceRoot":"","sources":["../src/AppContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,CAAC,IAAM,aAAa,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;AACnD,MAAM,CAAC,IAAM,cAAc,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;AACpD,MAAM,CAAC,IAAM,WAAW,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;AACjD,MAAM,CAAC,IAAM,2BAA2B,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;AACjE,MAAM,CAAC,IAAM,cA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1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface YAxisField {
|
|
3
|
+
label: string;
|
|
4
|
+
field: string;
|
|
5
|
+
chartType?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface BarListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
data: object[];
|
|
9
|
+
valueFormatter?: any;
|
|
10
|
+
color?: string;
|
|
11
|
+
showAnimation?: boolean;
|
|
12
|
+
xAxisField: string;
|
|
13
|
+
chartType: string;
|
|
14
|
+
yAxisFields: YAxisField[];
|
|
15
|
+
}
|
|
16
|
+
declare const BarList: React.ForwardRefExoticComponent<BarListProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export default BarList;
|
package/lib/BarList.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
/* eslint-disable react/display-name */
|
|
25
|
+
import React from 'react';
|
|
26
|
+
import { twMerge } from 'tailwind-merge';
|
|
27
|
+
var getWidthsFromValues = function (dataValues) {
|
|
28
|
+
var maxValue = -Infinity;
|
|
29
|
+
dataValues.forEach(function (value) {
|
|
30
|
+
maxValue = Math.max(maxValue, value);
|
|
31
|
+
});
|
|
32
|
+
return dataValues.map(function (value) {
|
|
33
|
+
if (value === 0)
|
|
34
|
+
return 0;
|
|
35
|
+
return Math.max((value / maxValue) * 100, 1);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
function makeBarListClassName(componentName) {
|
|
39
|
+
return function (className) {
|
|
40
|
+
return "BarList-".concat(componentName, "-").concat(className, ";");
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
var valueFormatter = function (number) {
|
|
44
|
+
// return '$ ' + Intl.NumberFormat('us').format(number).toString();
|
|
45
|
+
return number.toFixed(0);
|
|
46
|
+
};
|
|
47
|
+
var BarList = React.forwardRef(function (props, ref) {
|
|
48
|
+
var _a = props.data, data = _a === void 0 ? [] : _a, yAxisFields = props.yAxisFields, xAxisField = props.xAxisField, _b = props.color, color = _b === void 0 ? 'blue' : _b,
|
|
49
|
+
// valueFormatter = (value: any) => value,valueFormatter
|
|
50
|
+
_c = props.showAnimation,
|
|
51
|
+
// valueFormatter = (value: any) => value,valueFormatter
|
|
52
|
+
showAnimation = _c === void 0 ? true : _c, className = props.className, other = __rest(props, ["data", "yAxisFields", "xAxisField", "color", "showAnimation", "className"]);
|
|
53
|
+
var widths = getWidthsFromValues(data.map(function (item) { return item.median_days; }));
|
|
54
|
+
var rowHeight = 'h-9';
|
|
55
|
+
return (_jsxs("div", __assign({ ref: ref, style: { width: '100%' }, className: twMerge(
|
|
56
|
+
// makeBarListClassName('root'),
|
|
57
|
+
'flex justify-between', 'space-x-6', className) }, other, { children: [_jsx("div", __assign({
|
|
58
|
+
// className={twMerge(makeBarListClassName('bars'), 'relative w-full')}
|
|
59
|
+
className: "relative-w-full bg-[#212121]", style: { width: '100%' } }, { children: data.map(function (item, idx) {
|
|
60
|
+
// const Icon = item.icon;
|
|
61
|
+
var Icon = null;
|
|
62
|
+
return (_jsx("div", __assign({ className: "flex items-center h-9 rounded mb-2",
|
|
63
|
+
// className={twMerge(
|
|
64
|
+
// // makeBarListClassName('bar'),
|
|
65
|
+
// 'flex items-center',
|
|
66
|
+
// rowHeight,
|
|
67
|
+
// 'bg-black',
|
|
68
|
+
// 'rounded',
|
|
69
|
+
// idx === data.length - 1 ? 'mb-0' : 'mb-2'
|
|
70
|
+
// )}
|
|
71
|
+
style: {
|
|
72
|
+
width: "".concat(widths[idx], "%"),
|
|
73
|
+
transition: showAnimation ? 'all 2s' : '',
|
|
74
|
+
backgroundColor: color,
|
|
75
|
+
} }, { children: _jsx("div", __assign({ className: twMerge('absolute max-w-full flex', 'ml-2') }, { children: _jsx("p", __assign({ className: twMerge(
|
|
76
|
+
// makeBarListClassName('barText'),
|
|
77
|
+
'whitespace-nowrap truncate', 'text-gray-500', 'text-sm') }, { children: item.name })) })) }), item.name));
|
|
78
|
+
}) })), _jsx("div", __assign({ className: (makeBarListClassName('labels'), 'text-right min-w-min') }, { children: data.map(function (item, idx) { return (_jsx("div", __assign({ className: twMerge(makeBarListClassName('labelWrapper'), 'flex justify-end items-center', rowHeight, idx === data.length - 1 ? 'mb-0' : 'mb-2') }, { children: _jsx("p", __assign({ className: twMerge(makeBarListClassName('labelText'), 'whitespace-nowrap truncate', 'text-gray-500', 'text-sm') }, { children: valueFormatter(item[yAxisFields[0].field]) })) }), item[xAxisField])); }) }))] })));
|
|
79
|
+
});
|
|
80
|
+
export default BarList;
|
|
81
|
+
//# sourceMappingURL=BarList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarList.js","sourceRoot":"","sources":["../src/BarList.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AAC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B,CAAC,gBACrE,IAAI,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,GAAG,IAAK,OAAA,CACvB,uBAEE,SAAS,EAAE,OAAO,CAChB,oBAAoB,CAAC,cAAc,CAAC,EACpC,+BAA+B,EAC/B,SAAS,EACT,GAAG,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAC1C,gBAED,qBACE,SAAS,EAAE,OAAO,CAChB,oBAAoB,CAAC,WAAW,CAAC,EACjC,4BAA4B,EAC5B,eAAe,EACf,SAAS,CACV,gBAEA,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IACzC,KAjBC,IAAI,CAAC,UAAU,CAAC,CAkBjB,CACP,EArBwB,CAqBxB,CAAC,IACE,KACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
package/lib/Button.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const colorValues: readonly ["slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose"];
|
|
3
|
+
export type Color = (typeof colorValues)[number];
|
|
4
|
+
interface ButtonProps {
|
|
5
|
+
text: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ChartTooltipFrame: ({ children, }: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}) => JSX.Element;
|
|
12
|
+
export interface ChartTooltipRowProps {
|
|
13
|
+
value: string;
|
|
14
|
+
name: string;
|
|
15
|
+
color: Color;
|
|
16
|
+
}
|
|
17
|
+
export declare const ChartTooltipRow: ({ value, name, color, }: ChartTooltipRowProps) => JSX.Element;
|
|
18
|
+
export interface ChartTooltipProps {
|
|
19
|
+
active: boolean | undefined;
|
|
20
|
+
payload: any;
|
|
21
|
+
label: string;
|
|
22
|
+
categoryColors: Map<string, Color>;
|
|
23
|
+
valueFormatter: any;
|
|
24
|
+
}
|
|
25
|
+
declare const Chart: React.FC<ButtonProps>;
|
|
26
|
+
export default Chart;
|