@quillsql/react 1.1.8 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/lib/BarList.d.ts +1 -0
  2. package/lib/BarList.js +129 -37
  3. package/lib/BarList.js.map +1 -1
  4. package/lib/Chart.d.ts +3 -3
  5. package/lib/Chart.js +66 -30
  6. package/lib/Chart.js.map +1 -1
  7. package/lib/Context.d.ts +1 -1
  8. package/lib/Dashboard.d.ts +1 -1
  9. package/lib/Dashboard.js +0 -4
  10. package/lib/Dashboard.js.map +1 -1
  11. package/lib/DateRangePicker/Calendar.d.ts +1 -1
  12. package/lib/DateRangePicker/Calendar.js +122 -23
  13. package/lib/DateRangePicker/Calendar.js.map +1 -1
  14. package/lib/DateRangePicker/DateRangePicker.js +5 -6
  15. package/lib/DateRangePicker/DateRangePicker.js.map +1 -1
  16. package/lib/DateRangePicker/DateRangePickerButton.d.ts +1 -1
  17. package/lib/DateRangePicker/DateRangePickerButton.js +101 -17
  18. package/lib/DateRangePicker/DateRangePickerButton.js.map +1 -1
  19. package/lib/DateRangePicker/dateRangePickerUtils.d.ts +1 -3
  20. package/lib/DateRangePicker/dateRangePickerUtils.js +113 -79
  21. package/lib/DateRangePicker/dateRangePickerUtils.js.map +1 -1
  22. package/lib/PieChart.d.ts +3 -10
  23. package/lib/PieChart.js +51 -103
  24. package/lib/PieChart.js.map +1 -1
  25. package/lib/QuillProvider.d.ts +1 -2
  26. package/lib/assets/ArrowDownHeadIcon.d.ts +1 -2
  27. package/lib/assets/ArrowDownIcon.d.ts +1 -2
  28. package/lib/assets/ArrowDownRightIcon.d.ts +1 -2
  29. package/lib/assets/ArrowLeftHeadIcon.d.ts +1 -2
  30. package/lib/assets/ArrowRightHeadIcon.d.ts +1 -2
  31. package/lib/assets/ArrowRightIcon.d.ts +1 -2
  32. package/lib/assets/ArrowUpHeadIcon.d.ts +1 -2
  33. package/lib/assets/ArrowUpIcon.d.ts +1 -2
  34. package/lib/assets/ArrowUpRightIcon.d.ts +1 -2
  35. package/lib/assets/CalendarIcon.d.ts +1 -2
  36. package/lib/assets/DoubleArrowLeftHeadIcon.d.ts +1 -2
  37. package/lib/assets/DoubleArrowRightHeadIcon.d.ts +1 -2
  38. package/lib/assets/ExclamationFilledIcon.d.ts +1 -2
  39. package/lib/assets/LoadingSpinner.d.ts +1 -2
  40. package/lib/assets/SearchIcon.d.ts +1 -2
  41. package/lib/assets/XCircleIcon.d.ts +1 -2
  42. package/lib/components/Dropdown/Dropdown.js +45 -14
  43. package/lib/components/Dropdown/Dropdown.js.map +1 -1
  44. package/lib/components/Dropdown/DropdownItem.d.ts +1 -0
  45. package/lib/components/Dropdown/DropdownItem.js +21 -29
  46. package/lib/components/Dropdown/DropdownItem.js.map +1 -1
  47. package/lib/components/Modal/Modal.d.ts +1 -0
  48. package/lib/components/Modal/Modal.js +47 -9
  49. package/lib/components/Modal/Modal.js.map +1 -1
  50. package/lib/components/selectUtils.d.ts +1 -1
  51. package/lib/components/selectUtils.js +18 -12
  52. package/lib/components/selectUtils.js.map +1 -1
  53. package/lib/contexts/BaseColorContext.d.ts +1 -1
  54. package/lib/contexts/BaseColorContext.js +1 -2
  55. package/lib/contexts/BaseColorContext.js.map +1 -1
  56. package/lib/lib/index.d.ts +0 -7
  57. package/lib/lib/index.js +0 -7
  58. package/lib/lib/index.js.map +1 -1
  59. package/lib/lib/utils.d.ts +1 -4
  60. package/lib/lib/utils.js +4 -33
  61. package/lib/lib/utils.js.map +1 -1
  62. package/package.json +1 -8
  63. package/src/BarList.tsx +193 -96
  64. package/src/Chart.tsx +108 -48
  65. package/src/Dashboard.tsx +10 -10
  66. package/src/DateRangePicker/Calendar.tsx +149 -165
  67. package/src/DateRangePicker/DateRangePicker.tsx +11 -11
  68. package/src/DateRangePicker/DateRangePickerButton.tsx +129 -84
  69. package/src/DateRangePicker/dateRangePickerUtils.tsx +137 -117
  70. package/src/PieChart.tsx +87 -111
  71. package/src/components/Dropdown/Dropdown.tsx +50 -69
  72. package/src/components/Dropdown/DropdownItem.tsx +15 -50
  73. package/src/components/Modal/Modal.tsx +50 -31
  74. package/src/components/selectUtils.ts +19 -26
  75. package/src/contexts/BaseColorContext.tsx +1 -4
  76. package/src/lib/index.ts +0 -7
  77. package/src/lib/utils.tsx +8 -43
  78. package/src/styles.css +0 -5
  79. package/example/README.md +0 -46
  80. package/example/package-lock.json +0 -12111
  81. package/example/package.json +0 -43
  82. package/example/public/favicon.ico +0 -0
  83. package/example/public/index.html +0 -43
  84. package/example/public/logo192.png +0 -0
  85. package/example/public/logo512.png +0 -0
  86. package/example/public/manifest.json +0 -25
  87. package/example/public/robots.txt +0 -3
  88. package/example/src/App.css +0 -38
  89. package/example/src/App.test.tsx +0 -9
  90. package/example/src/App.tsx +0 -47
  91. package/example/src/index.css +0 -13
  92. package/example/src/index.tsx +0 -19
  93. package/example/src/logo.svg +0 -1
  94. package/example/src/react-app-env.d.ts +0 -1
  95. package/example/src/reportWebVitals.ts +0 -15
  96. package/example/src/setupTests.ts +0 -5
  97. package/example/tsconfig.json +0 -26
  98. package/postcss.config.js +0 -6
  99. package/src/lib/colorClassNames.ts +0 -3191
  100. package/src/lib/constants.ts +0 -58
  101. package/src/lib/hexColors.ts +0 -28
  102. package/src/lib/shape.ts +0 -75
  103. package/src/lib/sizing.ts +0 -47
  104. package/src/lib/spacing.ts +0 -264
  105. package/src/lib/theme.ts +0 -49
  106. package/tailwind.config.js +0 -23
@@ -1,13 +1,5 @@
1
- import {
2
- BaseColors,
3
- DEFAULT_COLOR,
4
- WHITE,
5
- colorClassNames,
6
- colorPalette,
7
- getColorClassNames,
8
- } from '../lib';
9
1
  import React from 'react';
10
- import { twMerge } from 'tailwind-merge';
2
+ // import { twMerge } from 'tailwind-merge';
11
3
 
12
4
  export interface SelectItemProps {
13
5
  value: string;
@@ -44,23 +36,24 @@ export const getSelectButtonColors = (
44
36
  isDisabled: boolean,
45
37
  hasError = false
46
38
  ) => {
47
- return twMerge(
48
- isDisabled
49
- ? getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground).bgColor
50
- : getColorClassNames(WHITE, colorPalette.background).bgColor,
51
- !isDisabled &&
52
- getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
53
- .hoverBgColor,
54
- hasSelection
55
- ? getColorClassNames(DEFAULT_COLOR, colorPalette.darkText).textColor
56
- : getColorClassNames(DEFAULT_COLOR, colorPalette.text).textColor,
57
- isDisabled &&
58
- getColorClassNames(DEFAULT_COLOR, colorPalette.lightText).textColor,
59
- hasError && colorClassNames[BaseColors.Rose][colorPalette.text].textColor,
60
- hasError
61
- ? colorClassNames[BaseColors.Rose][colorPalette.ring].borderColor
62
- : getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor
63
- );
39
+ return null;
40
+ // return twMerge(
41
+ // isDisabled
42
+ // ? getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground).bgColor
43
+ // : getColorClassNames(WHITE, colorPalette.background).bgColor,
44
+ // !isDisabled &&
45
+ // getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
46
+ // .hoverBgColor,
47
+ // hasSelection
48
+ // ? getColorClassNames(DEFAULT_COLOR, colorPalette.darkText).textColor
49
+ // : getColorClassNames(DEFAULT_COLOR, colorPalette.text).textColor,
50
+ // isDisabled &&
51
+ // getColorClassNames(DEFAULT_COLOR, colorPalette.lightText).textColor,
52
+ // hasError && colorClassNames[BaseColors.Rose][colorPalette.text].textColor,
53
+ // hasError
54
+ // ? colorClassNames[BaseColors.Rose][colorPalette.ring].borderColor
55
+ // : getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor
56
+ // );
64
57
  };
65
58
 
66
59
  export const hasValue = (value: string | null | undefined) =>
@@ -1,8 +1,5 @@
1
1
  import { createContext } from 'react';
2
2
 
3
- import { BaseColors } from '../lib';
4
- import { Color } from '../lib/inputTypes';
5
-
6
- const BaseColorContext = createContext<Color>(BaseColors.Blue);
3
+ const BaseColorContext = createContext<string>('blue');
7
4
 
8
5
  export default BaseColorContext;
package/src/lib/index.ts CHANGED
@@ -1,10 +1,3 @@
1
- export * from './hexColors';
2
- export * from './colorClassNames';
3
1
  export * from './inputTypes';
4
- export * from './constants';
5
- export * from './shape';
6
- export * from './sizing';
7
- export * from './spacing';
8
2
  export * from './font';
9
- export * from './theme';
10
3
  export * from './utils';
package/src/lib/utils.tsx CHANGED
@@ -1,25 +1,7 @@
1
- import { DeltaTypes } from "./constants";
2
- import { Color, ValueFormatter } from "./inputTypes";
3
- import { colorClassNames } from "./colorClassNames";
1
+ import { ValueFormatter } from './inputTypes';
4
2
 
5
- export const mapInputsToDeltaType = (deltaType: string, isIncreasePositive: boolean): string => {
6
- if (isIncreasePositive || deltaType === DeltaTypes.Unchanged) {
7
- return deltaType;
8
- }
9
- switch (deltaType) {
10
- case DeltaTypes.Increase:
11
- return DeltaTypes.Decrease;
12
- case DeltaTypes.ModerateIncrease:
13
- return DeltaTypes.ModerateDecrease;
14
- case DeltaTypes.Decrease:
15
- return DeltaTypes.Increase;
16
- case DeltaTypes.ModerateDecrease:
17
- return DeltaTypes.ModerateIncrease;
18
- }
19
- return "";
20
- };
21
-
22
- export const defaultValueFormatter: ValueFormatter = (value: number) => value.toString();
3
+ export const defaultValueFormatter: ValueFormatter = (value: number) =>
4
+ value.toString();
23
5
 
24
6
  export const sumNumericArray = (arr: number[]) =>
25
7
  arr.reduce((prefixSum, num) => prefixSum + num, 0);
@@ -46,15 +28,15 @@ export const stringIsNumeric = (str: string | undefined): boolean => {
46
28
  };
47
29
 
48
30
  export const stringEndsWithNumber = (str: string): boolean => {
49
- return stringIsNumeric(str.split("-").pop());
31
+ return stringIsNumeric(str.split('-').pop());
50
32
  };
51
33
 
52
34
  export function mergeRefs<T = any>(
53
- refs: Array<React.MutableRefObject<T> | React.LegacyRef<T>>,
35
+ refs: Array<React.MutableRefObject<T> | React.LegacyRef<T>>
54
36
  ): React.RefCallback<T> {
55
- return (value) => {
56
- refs.forEach((ref) => {
57
- if (typeof ref === "function") {
37
+ return value => {
38
+ refs.forEach(ref => {
39
+ if (typeof ref === 'function') {
58
40
  ref(value);
59
41
  } else if (ref != null) {
60
42
  (ref as React.MutableRefObject<T | null>).current = value;
@@ -62,20 +44,3 @@ export function mergeRefs<T = any>(
62
44
  });
63
45
  };
64
46
  }
65
-
66
- export function makeClassName(componentName: string) {
67
- return (className: string) => {
68
- return `tremor-${componentName}-${className}`;
69
- };
70
- }
71
-
72
- export function getColorClassNames(
73
- color: Color | "white" | "black" | "transparent",
74
- shade?: number,
75
- ) {
76
- if (colorClassNames[color] === undefined) return colorClassNames["gray"][500];
77
- if (color === "white" || color === "black" || color === "transparent" || !shade) {
78
- return colorClassNames[color][500];
79
- }
80
- return colorClassNames[color][shade];
81
- }
package/src/styles.css CHANGED
@@ -1,5 +0,0 @@
1
- /* src/styles.css */
2
-
3
- @import 'tailwindcss/base';
4
- @import 'tailwindcss/components';
5
- @import 'tailwindcss/utilities';
package/example/README.md DELETED
@@ -1,46 +0,0 @@
1
- # Getting Started with Create React App
2
-
3
- This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4
-
5
- ## Available Scripts
6
-
7
- In the project directory, you can run:
8
-
9
- ### `npm start`
10
-
11
- Runs the app in the development mode.\
12
- Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13
-
14
- The page will reload if you make edits.\
15
- You will also see any lint errors in the console.
16
-
17
- ### `npm test`
18
-
19
- Launches the test runner in the interactive watch mode.\
20
- See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21
-
22
- ### `npm run build`
23
-
24
- Builds the app for production to the `build` folder.\
25
- It correctly bundles React in production mode and optimizes the build for the best performance.
26
-
27
- The build is minified and the filenames include the hashes.\
28
- Your app is ready to be deployed!
29
-
30
- See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31
-
32
- ### `npm run eject`
33
-
34
- **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35
-
36
- If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37
-
38
- Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39
-
40
- You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41
-
42
- ## Learn More
43
-
44
- You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45
-
46
- To learn React, check out the [React documentation](https://reactjs.org/).