@quillsql/react 1.1.9 → 1.2.1

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 (58) hide show
  1. package/lib/DateRangePicker/Calendar.js +1 -1
  2. package/lib/DateRangePicker/Calendar.js.map +1 -1
  3. package/lib/DateRangePicker/dateRangePickerUtils.d.ts +1 -2
  4. package/lib/DateRangePicker/dateRangePickerUtils.js +4 -4
  5. package/lib/DateRangePicker/dateRangePickerUtils.js.map +1 -1
  6. package/lib/PieChart.d.ts +0 -7
  7. package/lib/PieChart.js +0 -75
  8. package/lib/PieChart.js.map +1 -1
  9. package/lib/components/selectUtils.js.map +1 -1
  10. package/lib/contexts/BaseColorContext.d.ts +1 -1
  11. package/lib/contexts/BaseColorContext.js +1 -2
  12. package/lib/contexts/BaseColorContext.js.map +1 -1
  13. package/lib/lib/index.d.ts +0 -7
  14. package/lib/lib/index.js +0 -7
  15. package/lib/lib/index.js.map +1 -1
  16. package/lib/lib/utils.d.ts +1 -4
  17. package/lib/lib/utils.js +4 -33
  18. package/lib/lib/utils.js.map +1 -1
  19. package/package.json +1 -1
  20. package/src/Chart.tsx +4 -1
  21. package/src/Context.tsx +3 -1
  22. package/src/Dashboard.tsx +4 -1
  23. package/src/DateRangePicker/Calendar.tsx +1 -3
  24. package/src/DateRangePicker/DateRangePickerButton.tsx +4 -0
  25. package/src/DateRangePicker/dateRangePickerUtils.tsx +1 -7
  26. package/src/PieChart.tsx +0 -77
  27. package/src/QuillProvider.tsx +2 -0
  28. package/src/components/selectUtils.ts +0 -8
  29. package/src/contexts/BaseColorContext.tsx +1 -4
  30. package/src/hooks/useQuill.ts +4 -1
  31. package/src/lib/index.ts +0 -7
  32. package/src/lib/utils.tsx +8 -43
  33. package/example/README.md +0 -46
  34. package/example/package-lock.json +0 -11222
  35. package/example/package.json +0 -43
  36. package/example/public/favicon.ico +0 -0
  37. package/example/public/index.html +0 -43
  38. package/example/public/logo192.png +0 -0
  39. package/example/public/logo512.png +0 -0
  40. package/example/public/manifest.json +0 -25
  41. package/example/public/robots.txt +0 -3
  42. package/example/src/App.css +0 -38
  43. package/example/src/App.test.tsx +0 -9
  44. package/example/src/App.tsx +0 -48
  45. package/example/src/index.css +0 -13
  46. package/example/src/index.tsx +0 -19
  47. package/example/src/logo.svg +0 -1
  48. package/example/src/react-app-env.d.ts +0 -1
  49. package/example/src/reportWebVitals.ts +0 -15
  50. package/example/src/setupTests.ts +0 -5
  51. package/example/tsconfig.json +0 -26
  52. package/src/lib/colorClassNames.ts +0 -3191
  53. package/src/lib/constants.ts +0 -58
  54. package/src/lib/hexColors.ts +0 -28
  55. package/src/lib/shape.ts +0 -75
  56. package/src/lib/sizing.ts +0 -47
  57. package/src/lib/spacing.ts +0 -264
  58. package/src/lib/theme.ts +0 -49
@@ -12,7 +12,6 @@ import {
12
12
  startOfYear,
13
13
  sub,
14
14
  } from 'date-fns';
15
- import { Color } from '../lib/inputTypes';
16
15
  import { DateRangePickerOption } from './DateRangePicker';
17
16
  import { hexToRgbaWith10PercentAlpha } from '../BarList';
18
17
 
@@ -139,8 +138,7 @@ export const getDateStyles = (
139
138
  finalStartDate: Date | null,
140
139
  finalEndDate: Date | null,
141
140
  hoveredDate: Date | undefined,
142
- isDateDisabled: boolean,
143
- color: Color
141
+ isDateDisabled: boolean
144
142
  ) => {
145
143
  return {
146
144
  ...getDayTextClassNames(
@@ -149,7 +147,6 @@ export const getDateStyles = (
149
147
  finalStartDate,
150
148
  finalEndDate,
151
149
  hoveredDate as Date | null,
152
- color,
153
150
  isDateDisabled
154
151
  ),
155
152
  // ...getDayHoverBgColorClassName(
@@ -170,7 +167,6 @@ export const getDateStyles = (
170
167
  finalStartDate,
171
168
  finalEndDate,
172
169
  hoveredDate as Date | null,
173
- color,
174
170
  isDateDisabled
175
171
  ),
176
172
  };
@@ -324,7 +320,6 @@ const getDayBgColorClassName = (
324
320
  selectedStartDay: Date | null,
325
321
  selectedEndDay: Date | null,
326
322
  hoveredDay: Date | null,
327
- color: Color,
328
323
  isDayDisabled = false
329
324
  ) => {
330
325
  const styles = {
@@ -370,7 +365,6 @@ const getDayTextClassNames = (
370
365
  selectedStartDay: Date | null,
371
366
  selectedEndDay: Date | null,
372
367
  hoveredDay: Date | null,
373
- color: Color,
374
368
  isDayDisabled = false
375
369
  ) => {
376
370
  const styles = {
package/src/PieChart.tsx CHANGED
@@ -229,83 +229,6 @@ export type FlexDirection = 'row' | 'col' | 'row-reverse' | 'col-reverse';
229
229
  export const defaultValueFormatter: ValueFormatter = (value: number) =>
230
230
  (value * 1).toFixed(1) + '%';
231
231
 
232
- export const BaseColors: { [key: string]: Color } = {
233
- Slate: 'slate',
234
- Gray: 'gray',
235
- Zinc: 'zinc',
236
- Neutral: 'neutral',
237
- Stone: 'stone',
238
- Red: 'red',
239
- Orange: 'orange',
240
- Amber: 'amber',
241
- Yellow: 'yellow',
242
- Lime: 'lime',
243
- Green: 'green',
244
- Emerald: 'emerald',
245
- Teal: 'teal',
246
- Cyan: 'cyan',
247
- Sky: 'sky',
248
- Blue: 'blue',
249
- Indigo: 'indigo',
250
- Violet: 'violet',
251
- Purple: 'purple',
252
- Fuchsia: 'fuchsia',
253
- Pink: 'pink',
254
- Rose: 'rose',
255
- };
256
-
257
- export const hexColors: { [color: string]: string } = {
258
- [BaseColors.Slate]: '#64748b',
259
- [BaseColors.Gray]: '#6b7280',
260
- [BaseColors.Zinc]: '#71717a',
261
- [BaseColors.Neutral]: '#737373',
262
- [BaseColors.Stone]: '#78716c',
263
- [BaseColors.Red]: '#ef4444',
264
- [BaseColors.Orange]: '#f97316',
265
- [BaseColors.Amber]: '#f59e0b',
266
- [BaseColors.Yellow]: '#eab308',
267
- [BaseColors.Lime]: '#84cc16',
268
- [BaseColors.Green]: '#22c55e',
269
- [BaseColors.Emerald]: '#10b981',
270
- [BaseColors.Teal]: '#14b8a6',
271
- [BaseColors.Cyan]: '#06b6d4',
272
- [BaseColors.Sky]: '#0ea5e9',
273
- [BaseColors.Blue]: '#3b82f6',
274
- [BaseColors.Indigo]: '#6366f1',
275
- [BaseColors.Violet]: '#8b5cf6',
276
- [BaseColors.Purple]: '#a855f7',
277
- [BaseColors.Fuchsia]: '#d946ef',
278
- [BaseColors.Pink]: '#ec4899',
279
- [BaseColors.Rose]: '#f43f5e',
280
- [BaseColors.Black]: '#000000',
281
- [BaseColors.White]: '#ffffff',
282
- };
283
-
284
- export const themeColorRange: Color[] = [
285
- BaseColors.Cyan,
286
- BaseColors.Sky,
287
- BaseColors.Blue,
288
- BaseColors.Indigo,
289
- BaseColors.Violet,
290
- BaseColors.Purple,
291
- BaseColors.Fuchsia,
292
- BaseColors.Slate,
293
- BaseColors.Gray,
294
- BaseColors.Zinc,
295
- BaseColors.Neutral,
296
- BaseColors.Stone,
297
- BaseColors.Red,
298
- BaseColors.Orange,
299
- BaseColors.Amber,
300
- BaseColors.Yellow,
301
- BaseColors.Lime,
302
- BaseColors.Green,
303
- BaseColors.Emerald,
304
- BaseColors.Teal,
305
- BaseColors.Pink,
306
- BaseColors.Rose,
307
- ];
308
-
309
232
  export const sumNumericArray = (arr: number[]) =>
310
233
  arr.reduce((prefixSum, num) => prefixSum + num, 0);
311
234
 
@@ -6,6 +6,7 @@ const QuillProvider = ({
6
6
  organizationId,
7
7
  authToken,
8
8
  publicKey,
9
+ environment,
9
10
  theme,
10
11
  containerStyle,
11
12
  runQueryButton,
@@ -19,6 +20,7 @@ const QuillProvider = ({
19
20
  initialTheme={theme}
20
21
  authToken={authToken}
21
22
  publicKey={publicKey}
23
+ environment={environment}
22
24
  customerId={organizationId}
23
25
  >
24
26
  {children}
@@ -1,11 +1,3 @@
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
2
  // import { twMerge } from 'tailwind-merge';
11
3
 
@@ -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;
@@ -17,7 +17,7 @@ export const useQuill = (chartId: string) => {
17
17
  return;
18
18
  }
19
19
  // @ts-ignore
20
- const { publicKey, customerId } = client;
20
+ const { publicKey, customerId, environment } = client;
21
21
  const resp = await axios.get(
22
22
  'https://quill-344421.uc.r.appspot.com/item',
23
23
  {
@@ -26,6 +26,9 @@ export const useQuill = (chartId: string) => {
26
26
  orgId: customerId,
27
27
  publicKey: publicKey,
28
28
  },
29
+ headers: {
30
+ environment: environment || undefined,
31
+ },
29
32
  }
30
33
  );
31
34
  setReport(resp.data);
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/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/).