@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.
- package/lib/BarList.d.ts +1 -0
- package/lib/BarList.js +129 -37
- package/lib/BarList.js.map +1 -1
- package/lib/Chart.d.ts +3 -3
- package/lib/Chart.js +66 -30
- package/lib/Chart.js.map +1 -1
- package/lib/Context.d.ts +1 -1
- package/lib/Dashboard.d.ts +1 -1
- package/lib/Dashboard.js +0 -4
- package/lib/Dashboard.js.map +1 -1
- package/lib/DateRangePicker/Calendar.d.ts +1 -1
- package/lib/DateRangePicker/Calendar.js +122 -23
- package/lib/DateRangePicker/Calendar.js.map +1 -1
- package/lib/DateRangePicker/DateRangePicker.js +5 -6
- package/lib/DateRangePicker/DateRangePicker.js.map +1 -1
- package/lib/DateRangePicker/DateRangePickerButton.d.ts +1 -1
- package/lib/DateRangePicker/DateRangePickerButton.js +101 -17
- package/lib/DateRangePicker/DateRangePickerButton.js.map +1 -1
- package/lib/DateRangePicker/dateRangePickerUtils.d.ts +1 -3
- package/lib/DateRangePicker/dateRangePickerUtils.js +113 -79
- package/lib/DateRangePicker/dateRangePickerUtils.js.map +1 -1
- package/lib/PieChart.d.ts +3 -10
- package/lib/PieChart.js +51 -103
- package/lib/PieChart.js.map +1 -1
- package/lib/QuillProvider.d.ts +1 -2
- package/lib/assets/ArrowDownHeadIcon.d.ts +1 -2
- package/lib/assets/ArrowDownIcon.d.ts +1 -2
- package/lib/assets/ArrowDownRightIcon.d.ts +1 -2
- package/lib/assets/ArrowLeftHeadIcon.d.ts +1 -2
- package/lib/assets/ArrowRightHeadIcon.d.ts +1 -2
- package/lib/assets/ArrowRightIcon.d.ts +1 -2
- package/lib/assets/ArrowUpHeadIcon.d.ts +1 -2
- package/lib/assets/ArrowUpIcon.d.ts +1 -2
- package/lib/assets/ArrowUpRightIcon.d.ts +1 -2
- package/lib/assets/CalendarIcon.d.ts +1 -2
- package/lib/assets/DoubleArrowLeftHeadIcon.d.ts +1 -2
- package/lib/assets/DoubleArrowRightHeadIcon.d.ts +1 -2
- package/lib/assets/ExclamationFilledIcon.d.ts +1 -2
- package/lib/assets/LoadingSpinner.d.ts +1 -2
- package/lib/assets/SearchIcon.d.ts +1 -2
- package/lib/assets/XCircleIcon.d.ts +1 -2
- package/lib/components/Dropdown/Dropdown.js +45 -14
- package/lib/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/Dropdown/DropdownItem.d.ts +1 -0
- package/lib/components/Dropdown/DropdownItem.js +21 -29
- package/lib/components/Dropdown/DropdownItem.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts +1 -0
- package/lib/components/Modal/Modal.js +47 -9
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/selectUtils.d.ts +1 -1
- package/lib/components/selectUtils.js +18 -12
- package/lib/components/selectUtils.js.map +1 -1
- package/lib/contexts/BaseColorContext.d.ts +1 -1
- package/lib/contexts/BaseColorContext.js +1 -2
- package/lib/contexts/BaseColorContext.js.map +1 -1
- package/lib/lib/index.d.ts +0 -7
- package/lib/lib/index.js +0 -7
- package/lib/lib/index.js.map +1 -1
- package/lib/lib/utils.d.ts +1 -4
- package/lib/lib/utils.js +4 -33
- package/lib/lib/utils.js.map +1 -1
- package/package.json +1 -8
- package/src/BarList.tsx +193 -96
- package/src/Chart.tsx +108 -48
- package/src/Dashboard.tsx +10 -10
- package/src/DateRangePicker/Calendar.tsx +149 -165
- package/src/DateRangePicker/DateRangePicker.tsx +11 -11
- package/src/DateRangePicker/DateRangePickerButton.tsx +129 -84
- package/src/DateRangePicker/dateRangePickerUtils.tsx +137 -117
- package/src/PieChart.tsx +87 -111
- package/src/components/Dropdown/Dropdown.tsx +50 -69
- package/src/components/Dropdown/DropdownItem.tsx +15 -50
- package/src/components/Modal/Modal.tsx +50 -31
- package/src/components/selectUtils.ts +19 -26
- package/src/contexts/BaseColorContext.tsx +1 -4
- package/src/lib/index.ts +0 -7
- package/src/lib/utils.tsx +8 -43
- package/src/styles.css +0 -5
- package/example/README.md +0 -46
- package/example/package-lock.json +0 -12111
- package/example/package.json +0 -43
- package/example/public/favicon.ico +0 -0
- package/example/public/index.html +0 -43
- package/example/public/logo192.png +0 -0
- package/example/public/logo512.png +0 -0
- package/example/public/manifest.json +0 -25
- package/example/public/robots.txt +0 -3
- package/example/src/App.css +0 -38
- package/example/src/App.test.tsx +0 -9
- package/example/src/App.tsx +0 -47
- package/example/src/index.css +0 -13
- package/example/src/index.tsx +0 -19
- package/example/src/logo.svg +0 -1
- package/example/src/react-app-env.d.ts +0 -1
- package/example/src/reportWebVitals.ts +0 -15
- package/example/src/setupTests.ts +0 -5
- package/example/tsconfig.json +0 -26
- package/postcss.config.js +0 -6
- package/src/lib/colorClassNames.ts +0 -3191
- package/src/lib/constants.ts +0 -58
- package/src/lib/hexColors.ts +0 -28
- package/src/lib/shape.ts +0 -75
- package/src/lib/sizing.ts +0 -47
- package/src/lib/spacing.ts +0 -264
- package/src/lib/theme.ts +0 -49
- package/tailwind.config.js +0 -23
|
@@ -20,51 +20,43 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import { jsx as _jsx
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
24
|
/* eslint-disable react/display-name */
|
|
25
25
|
import React, { useContext } from 'react';
|
|
26
|
-
import { twMerge } from 'tailwind-merge';
|
|
27
26
|
import { HoveredValueContext, SelectedValueContext } from '../../contexts';
|
|
28
|
-
import { fontSize } from '../../lib/font';
|
|
29
|
-
import { sizing } from '../../lib/sizing';
|
|
30
|
-
import { spacing } from '../../lib/spacing';
|
|
31
|
-
import { getColorClassNames, makeClassName } from '../../lib';
|
|
32
|
-
import { DEFAULT_COLOR, colorPalette } from '../../lib/theme';
|
|
33
|
-
var makeDropdownItemClassName = makeClassName('DropdownItem');
|
|
34
27
|
var DropdownItem = React.forwardRef(function (props, ref) {
|
|
35
|
-
var value = props.value, text = props.text, icon = props.icon, className = props.className, theme = props.theme, other = __rest(props, ["value", "text", "icon", "className", "theme"]);
|
|
28
|
+
var value = props.value, text = props.text, icon = props.icon, className = props.className, theme = props.theme, lastItem = props.lastItem, other = __rest(props, ["value", "text", "icon", "className", "theme", "lastItem"]);
|
|
36
29
|
var _a = useContext(SelectedValueContext), selectedValue = _a.selectedValue, handleValueChange = _a.handleValueChange;
|
|
37
30
|
var hoveredValue = useContext(HoveredValueContext).hoveredValue;
|
|
38
31
|
var isActive = selectedValue === value;
|
|
39
32
|
var isHovered = hoveredValue === value;
|
|
40
|
-
var bgColor = isActive
|
|
41
|
-
? getColorClassNames(DEFAULT_COLOR, colorPalette.lightBackground).bgColor
|
|
42
|
-
: isHovered
|
|
43
|
-
? getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground).bgColor
|
|
44
|
-
: getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
45
|
-
.hoverBgColor;
|
|
46
|
-
var textColor = isActive
|
|
47
|
-
? getColorClassNames(DEFAULT_COLOR, colorPalette.darkestText).textColor
|
|
48
|
-
: getColorClassNames(DEFAULT_COLOR, colorPalette.darkText).textColor;
|
|
49
33
|
var Icon = icon ? icon : null;
|
|
50
|
-
return (
|
|
51
|
-
|
|
34
|
+
return (_jsx("button", __assign({ ref: ref, style: {
|
|
35
|
+
display: 'flex',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'start',
|
|
38
|
+
width: '100%',
|
|
39
|
+
overflow: 'hidden',
|
|
40
|
+
textOverflow: 'ellipsis',
|
|
41
|
+
padding: '0.75rem 2rem',
|
|
42
|
+
fontSize: '0.875rem',
|
|
52
43
|
borderStyle: 'solid',
|
|
53
|
-
borderBottomWidth:
|
|
44
|
+
borderBottomWidth: lastItem ? '0px' : '1px',
|
|
54
45
|
borderBottomColor: (theme === null || theme === void 0 ? void 0 : theme.borderColor) || '#E5E7EB',
|
|
55
46
|
background: (theme === null || theme === void 0 ? void 0 : theme.backgroundColor) || 'white',
|
|
56
47
|
borderTop: 'none',
|
|
57
48
|
borderRight: 'none',
|
|
58
49
|
borderLeft: 'none',
|
|
59
50
|
cursor: 'pointer',
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
color: (theme === null || theme === void 0 ? void 0 : theme.primaryTextColor) || '#364153',
|
|
52
|
+
}, type: "button", onClick: function () { return handleValueChange === null || handleValueChange === void 0 ? void 0 : handleValueChange(value); } }, other, { children: _jsx("p", __assign({ style: {
|
|
53
|
+
margin: 0,
|
|
54
|
+
fontFamily: theme === null || theme === void 0 ? void 0 : theme.fontFamily,
|
|
55
|
+
color: theme === null || theme === void 0 ? void 0 : theme.primaryTextColor,
|
|
56
|
+
whiteSpace: 'nowrap',
|
|
57
|
+
overflow: 'hidden',
|
|
58
|
+
textOverflow: 'ellipsis',
|
|
59
|
+
} }, { children: text !== null && text !== void 0 ? text : value })) })));
|
|
68
60
|
});
|
|
69
61
|
export default DropdownItem;
|
|
70
62
|
//# sourceMappingURL=DropdownItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownItem.js","sourceRoot":"","sources":["../../../src/components/Dropdown/DropdownItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownItem.js","sourceRoot":"","sources":["../../../src/components/Dropdown/DropdownItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAW3E,IAAM,Y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M;YAClB,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,gBAAgB,KAAI,SAAS;SAC5C,EACD,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,cAAM,OAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,KAAK,CAAC,EAA1B,CAA0B,IACrC,KAAK,cAET,qBACE,KAAK,EAAE;gBACL,MAAM,EAAE,CAAC;gBACT,UAAU,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU;gBAC7B,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,gBAAgB;gBAC9B,UAAU,EAAE,QAAQ;gBACpB,QAAQ,EAAE,QAAQ;gBAClB,YAAY,EAAE,UAAU;aACzB,gBAEA,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,KAAK,IACZ,IACG,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -8,6 +8,7 @@ export interface ModalProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
8
8
|
maxHeight?: string;
|
|
9
9
|
anchorPosition?: HorizontalPosition;
|
|
10
10
|
children: React.ReactNode;
|
|
11
|
+
theme: any;
|
|
11
12
|
}
|
|
12
13
|
declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
14
|
export default Modal;
|
|
@@ -23,12 +23,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
24
|
/* eslint-disable react/display-name */
|
|
25
25
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
26
|
-
import { twMerge } from 'tailwind-merge';
|
|
27
26
|
import { useOnClickOutside, useOnWindowResize } from '../../hooks';
|
|
28
|
-
import {
|
|
29
|
-
import { DEFAULT_COLOR, colorPalette } from '../../lib/theme';
|
|
27
|
+
import { mergeRefs } from '../../lib';
|
|
30
28
|
var Modal = React.forwardRef(function (props, ref) {
|
|
31
|
-
var showModal = props.showModal, setShowModal = props.setShowModal, parentRef = props.parentRef, width = props.width, _a = props.maxHeight, maxHeight = _a === void 0 ? '
|
|
29
|
+
var showModal = props.showModal, setShowModal = props.setShowModal, parentRef = props.parentRef, width = props.width, _a = props.maxHeight, maxHeight = _a === void 0 ? '18rem' : _a, children = props.children, className = props.className, theme = props.theme, other = __rest(props, ["showModal", "setShowModal", "parentRef", "width", "maxHeight", "children", "className", "theme"]);
|
|
32
30
|
var _b = useState(false), modalExceedsWindow = _b[0], setModalExceedsWindow = _b[1];
|
|
33
31
|
var modalRef = useRef(null);
|
|
34
32
|
var checkModalExceedsWindow = useCallback(function (modalWidth, windowWidth) {
|
|
@@ -39,10 +37,7 @@ var Modal = React.forwardRef(function (props, ref) {
|
|
|
39
37
|
return windowWidth - modalBoundingRight < 0;
|
|
40
38
|
}, [parentRef]);
|
|
41
39
|
var getAbsoluteSpacing = function () {
|
|
42
|
-
|
|
43
|
-
return spacing.none.left;
|
|
44
|
-
}
|
|
45
|
-
return spacing.none.right;
|
|
40
|
+
return modalExceedsWindow ? '0' : '0';
|
|
46
41
|
};
|
|
47
42
|
useOnClickOutside(modalRef, function (e) {
|
|
48
43
|
var _a;
|
|
@@ -65,7 +60,50 @@ var Modal = React.forwardRef(function (props, ref) {
|
|
|
65
60
|
setModalExceedsWindow(checkModalExceedsWindow(width, window.innerWidth));
|
|
66
61
|
}
|
|
67
62
|
});
|
|
68
|
-
return showModal ? (_jsx("div", __assign({ ref: mergeRefs([modalRef, ref]),
|
|
63
|
+
return showModal ? (_jsx("div", __assign({ ref: mergeRefs([modalRef, ref]), style: {
|
|
64
|
+
position: 'absolute',
|
|
65
|
+
zIndex: 10,
|
|
66
|
+
overflowY: 'auto',
|
|
67
|
+
width: width ? width : '100%',
|
|
68
|
+
left: getAbsoluteSpacing(),
|
|
69
|
+
right: getAbsoluteSpacing(),
|
|
70
|
+
maxHeight: maxHeight,
|
|
71
|
+
backgroundColor: (theme === null || theme === void 0 ? void 0 : theme.backgroundColor) || 'white',
|
|
72
|
+
borderColor: (theme === null || theme === void 0 ? void 0 : theme.borderColor) || '#E5E7EB',
|
|
73
|
+
// borderTopColor: getColorClassNames(
|
|
74
|
+
// DEFAULT_COLOR,
|
|
75
|
+
// colorPalette.lightBorder
|
|
76
|
+
// ).borderColor,
|
|
77
|
+
// borderBottomColor: getColorClassNames(
|
|
78
|
+
// DEFAULT_COLOR,
|
|
79
|
+
// colorPalette.lightBorder
|
|
80
|
+
// ).borderColor,
|
|
81
|
+
// borderLeftColor: getColorClassNames(
|
|
82
|
+
// DEFAULT_COLOR,
|
|
83
|
+
// colorPalette.lightBorder
|
|
84
|
+
// ).borderColor,
|
|
85
|
+
// borderRightColor: getColorClassNames(
|
|
86
|
+
// DEFAULT_COLOR,
|
|
87
|
+
// colorPalette.lightBorder
|
|
88
|
+
// ).borderColor,
|
|
89
|
+
borderTopStyle: 'solid',
|
|
90
|
+
borderBottomStyle: 'solid',
|
|
91
|
+
borderLeftStyle: 'solid',
|
|
92
|
+
borderRightStyle: 'solid',
|
|
93
|
+
borderTopWidth: 1,
|
|
94
|
+
borderBottomWidth: 1,
|
|
95
|
+
borderLeftWidth: 1,
|
|
96
|
+
borderRightWidth: 1,
|
|
97
|
+
marginTop: '0.5rem',
|
|
98
|
+
marginBottom: '0.5rem',
|
|
99
|
+
borderRadius: '0.375rem',
|
|
100
|
+
boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
|
|
101
|
+
// boxShadow: '0 1px 3px 0 #0000001A, 0 1px 2px 0 #0000000F',
|
|
102
|
+
// borderTopWidth: '2px',
|
|
103
|
+
// borderBottomWidth: '2px',
|
|
104
|
+
// borderLeftWidth: '2px',
|
|
105
|
+
// borderRightWidth: '2px',
|
|
106
|
+
} }, other, { children: children }))) : null;
|
|
69
107
|
});
|
|
70
108
|
export default Modal;
|
|
71
109
|
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGnE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAetC,IAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAA6B,UAAC,KAAK,EAAE,GAAG;IAElE,IAAA,SAAS,GASP,KAAK,UATE,EACT,YAAY,GAQV,KAAK,aARK,EACZ,SAAS,GAOP,KAAK,UAPE,EACT,KAAK,GAMH,KAAK,MANF,EACL,KAKE,KAAK,UALY,EAAnB,SAAS,mBAAG,OAAO,KAAA,EACnB,QAAQ,GAIN,KAAK,SAJC,EACR,SAAS,GAGP,KAAK,UAHE,EACT,KAAK,GAEH,KAAK,MAFF,EACF,KAAK,UACN,KAAK,EAVH,kGAUL,CADS,CACA;IACJ,IAAA,KAA8C,QAAQ,CAAC,KAAK,CAAC,EAA5D,kBAAkB,QAAA,EAAE,qBAAqB,QAAmB,CAAC;IAEpE,IAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE9C,IAAM,uBAAuB,GAAG,WAAW,CACzC,UAAC,UAAkB,EAAE,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AAM,EAAE,EAAE;YACV,SAAS,EAAE,MAAM;YACjB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;YAC7B,IAAI,EAAE,kBAAkB,EAAE;YAC1B,KAAK,EAAE,kBAAkB,EAAE;YAC3B,SAAS,EAAE,SAAS;YACpB,eAAe,EAAE,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,KAAI,OAAO;YAClD,WAAW,EAAE,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,KAAI,SAAS;YAC5C,sCAAsC;YACtC,mBAAmB;YACnB,6BAA6B;YAC7B,iBAAiB;YACjB,yCAAyC;YACzC,mBAAmB;YACnB,6BAA6B;YAC7B,iBAAiB;YACjB,uCAAuC;YACvC,mBAAmB;YACnB,6BAA6B;YAC7B,iBAAiB;YACjB,wCAAwC;YACxC,mBAAmB;YACnB,6BAA6B;YAC7B,iBAAiB;YACjB,cAAc,EAAE,OAAO;YACvB,iBAAiB,EAAE,OAAO;YAC1B,eAAe,EAAE,OAAO;YACxB,gBAAgB,EAAE,OAAO;YACzB,cAAc,EAAE,CAAC;YACjB,iBAAiB,EAAE,CAAC;YACpB,eAAe,EAAE,CAAC;YAClB,gBAAgB,EAAE,CAAC;YACnB,SAAS,EAAE,QAAQ;YACnB,YAAY,EAAE,QAAQ;YACtB,YAAY,EAAE,UAAU;YACxB,SAAS,EACP,kEAAkE;YACpE,6DAA6D;YAC7D,yBAAyB;YACzB,4BAA4B;YAC5B,0BAA0B;YAC1B,2BAA2B;SAC5B,IACG,KAAK,cAER,QAAQ,IACL,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -5,5 +5,5 @@ export interface SelectItemProps {
|
|
|
5
5
|
}
|
|
6
6
|
export declare function constructValueToNameMapping(children: React.ReactElement[] | React.ReactElement): Map<string, string>;
|
|
7
7
|
export declare function getFilteredOptions(searchQuery: string, options: SelectItemProps[]): SelectItemProps[];
|
|
8
|
-
export declare const getSelectButtonColors: (hasSelection: boolean, isDisabled: boolean, hasError?: boolean) =>
|
|
8
|
+
export declare const getSelectButtonColors: (hasSelection: boolean, isDisabled: boolean, hasError?: boolean) => null;
|
|
9
9
|
export declare const hasValue: (value: string | null | undefined) => boolean;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { BaseColors, DEFAULT_COLOR, WHITE, colorClassNames, colorPalette, getColorClassNames, } from '../lib';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { twMerge } from 'tailwind-merge';
|
|
4
2
|
export function constructValueToNameMapping(children) {
|
|
5
3
|
var valueToNameMapping = new Map();
|
|
6
4
|
React.Children.map(children, function (child) {
|
|
@@ -20,16 +18,24 @@ export function getFilteredOptions(searchQuery, options) {
|
|
|
20
18
|
}
|
|
21
19
|
export var getSelectButtonColors = function (hasSelection, isDisabled, hasError) {
|
|
22
20
|
if (hasError === void 0) { hasError = false; }
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
return null;
|
|
22
|
+
// return twMerge(
|
|
23
|
+
// isDisabled
|
|
24
|
+
// ? getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground).bgColor
|
|
25
|
+
// : getColorClassNames(WHITE, colorPalette.background).bgColor,
|
|
26
|
+
// !isDisabled &&
|
|
27
|
+
// getColorClassNames(DEFAULT_COLOR, colorPalette.canvasBackground)
|
|
28
|
+
// .hoverBgColor,
|
|
29
|
+
// hasSelection
|
|
30
|
+
// ? getColorClassNames(DEFAULT_COLOR, colorPalette.darkText).textColor
|
|
31
|
+
// : getColorClassNames(DEFAULT_COLOR, colorPalette.text).textColor,
|
|
32
|
+
// isDisabled &&
|
|
33
|
+
// getColorClassNames(DEFAULT_COLOR, colorPalette.lightText).textColor,
|
|
34
|
+
// hasError && colorClassNames[BaseColors.Rose][colorPalette.text].textColor,
|
|
35
|
+
// hasError
|
|
36
|
+
// ? colorClassNames[BaseColors.Rose][colorPalette.ring].borderColor
|
|
37
|
+
// : getColorClassNames(DEFAULT_COLOR, colorPalette.ring).borderColor
|
|
38
|
+
// );
|
|
33
39
|
};
|
|
34
40
|
export var hasValue = function (value) {
|
|
35
41
|
return value !== null && value !== undefined && value !== '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectUtils.js","sourceRoot":"","sources":["../../src/components/selectUtils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"selectUtils.js","sourceRoot":"","sources":["../../src/components/selectUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,UAAU,2BAA2B,CACzC,QAAmD;IAEnD,IAAM,kBAAkB,GAAG,IAAI,GAAG,EAAkB,CAAC;IACrD,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAC,KAAiC;;QAC7D,kBAAkB,CAAC,GAAG,CACpB,KAAK,CAAC,KAAK,CAAC,KAAK,EACjB,MAAA,KAAK,CAAC,KAAK,CAAC,IAAI,mCAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CACtC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,WAAmB,EACnB,OAA0B;IAE1B,OAAO,WAAW,KAAK,EAAE;QACvB,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,UAAC,MAAuB;;YACrC,IAAM,UAAU,GAAG,MAAA,MAAM,CAAC,IAAI,mCAAI,MAAM,CAAC,KAAK,CAAC;YAC/C,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;AACT,CAAC;AAED,MAAM,CAAC,IAAM,qBAAqB,GAAG,UACnC,YAAqB,EACrB,UAAmB,EACnB,QAAgB;IAAhB,yBAAA,EAAA,gBAAgB;IAEhB,OAAO,IAAI,CAAC;IACZ,kBAAkB;IAClB,eAAe;IACf,iFAAiF;IACjF,oEAAoE;IACpE,mBAAmB;IACnB,uEAAuE;IACvE,uBAAuB;IACvB,iBAAiB;IACjB,2EAA2E;IAC3E,wEAAwE;IACxE,kBAAkB;IAClB,2EAA2E;IAC3E,+EAA+E;IAC/E,aAAa;IACb,wEAAwE;IACxE,yEAAyE;IACzE,KAAK;AACP,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,QAAQ,GAAG,UAAC,KAAgC;IACvD,OAAA,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;AAArD,CAAqD,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const BaseColorContext: import("react").Context<
|
|
2
|
+
declare const BaseColorContext: import("react").Context<string>;
|
|
3
3
|
export default BaseColorContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseColorContext.js","sourceRoot":"","sources":["../../src/contexts/BaseColorContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,
|
|
1
|
+
{"version":3,"file":"BaseColorContext.js","sourceRoot":"","sources":["../../src/contexts/BaseColorContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,IAAM,gBAAgB,GAAG,aAAa,CAAS,MAAM,CAAC,CAAC;AAEvD,eAAe,gBAAgB,CAAC"}
|
package/lib/lib/index.d.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/lib/lib/index.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
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';
|
|
11
4
|
//# sourceMappingURL=index.js.map
|
package/lib/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
package/lib/lib/utils.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare const mapInputsToDeltaType: (deltaType: string, isIncreasePositive: boolean) => string;
|
|
2
|
+
import { ValueFormatter } from './inputTypes';
|
|
4
3
|
export declare const defaultValueFormatter: ValueFormatter;
|
|
5
4
|
export declare const sumNumericArray: (arr: number[]) => number;
|
|
6
5
|
export declare const removeValueFromArray: (value: any, array: any[]) => any[];
|
|
@@ -8,5 +7,3 @@ export declare const isValueInArray: (value: any, array: any[]) => boolean;
|
|
|
8
7
|
export declare const stringIsNumeric: (str: string | undefined) => boolean;
|
|
9
8
|
export declare const stringEndsWithNumber: (str: string) => boolean;
|
|
10
9
|
export declare function mergeRefs<T = any>(refs: Array<React.MutableRefObject<T> | React.LegacyRef<T>>): React.RefCallback<T>;
|
|
11
|
-
export declare function makeClassName(componentName: string): (className: string) => string;
|
|
12
|
-
export declare function getColorClassNames(color: Color | "white" | "black" | "transparent", shade?: number): import("./colorClassNames").ColorTypes;
|
package/lib/lib/utils.js
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export var mapInputsToDeltaType = function (deltaType, isIncreasePositive) {
|
|
4
|
-
if (isIncreasePositive || deltaType === DeltaTypes.Unchanged) {
|
|
5
|
-
return deltaType;
|
|
6
|
-
}
|
|
7
|
-
switch (deltaType) {
|
|
8
|
-
case DeltaTypes.Increase:
|
|
9
|
-
return DeltaTypes.Decrease;
|
|
10
|
-
case DeltaTypes.ModerateIncrease:
|
|
11
|
-
return DeltaTypes.ModerateDecrease;
|
|
12
|
-
case DeltaTypes.Decrease:
|
|
13
|
-
return DeltaTypes.Increase;
|
|
14
|
-
case DeltaTypes.ModerateDecrease:
|
|
15
|
-
return DeltaTypes.ModerateIncrease;
|
|
16
|
-
}
|
|
17
|
-
return "";
|
|
1
|
+
export var defaultValueFormatter = function (value) {
|
|
2
|
+
return value.toString();
|
|
18
3
|
};
|
|
19
|
-
export var defaultValueFormatter = function (value) { return value.toString(); };
|
|
20
4
|
export var sumNumericArray = function (arr) {
|
|
21
5
|
return arr.reduce(function (prefixSum, num) { return prefixSum + num; }, 0);
|
|
22
6
|
};
|
|
@@ -39,12 +23,12 @@ export var stringIsNumeric = function (str) {
|
|
|
39
23
|
return !isNaN(Number(str)) && str !== undefined;
|
|
40
24
|
};
|
|
41
25
|
export var stringEndsWithNumber = function (str) {
|
|
42
|
-
return stringIsNumeric(str.split(
|
|
26
|
+
return stringIsNumeric(str.split('-').pop());
|
|
43
27
|
};
|
|
44
28
|
export function mergeRefs(refs) {
|
|
45
29
|
return function (value) {
|
|
46
30
|
refs.forEach(function (ref) {
|
|
47
|
-
if (typeof ref ===
|
|
31
|
+
if (typeof ref === 'function') {
|
|
48
32
|
ref(value);
|
|
49
33
|
}
|
|
50
34
|
else if (ref != null) {
|
|
@@ -53,17 +37,4 @@ export function mergeRefs(refs) {
|
|
|
53
37
|
});
|
|
54
38
|
};
|
|
55
39
|
}
|
|
56
|
-
export function makeClassName(componentName) {
|
|
57
|
-
return function (className) {
|
|
58
|
-
return "tremor-".concat(componentName, "-").concat(className);
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export function getColorClassNames(color, shade) {
|
|
62
|
-
if (colorClassNames[color] === undefined)
|
|
63
|
-
return colorClassNames["gray"][500];
|
|
64
|
-
if (color === "white" || color === "black" || color === "transparent" || !shade) {
|
|
65
|
-
return colorClassNames[color][500];
|
|
66
|
-
}
|
|
67
|
-
return colorClassNames[color][shade];
|
|
68
|
-
}
|
|
69
40
|
//# sourceMappingURL=utils.js.map
|
package/lib/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,IAAM,qBAAqB,GAAmB,UAAC,KAAa;IACjE,OAAA,KAAK,CAAC,QAAQ,EAAE;AAAhB,CAAgB,CAAC;AAEnB,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,GAAa;IAC3C,OAAA,GAAG,CAAC,MAAM,CAAC,UAAC,SAAS,EAAE,GAAG,IAAK,OAAA,SAAS,GAAG,GAAG,EAAf,CAAe,EAAE,CAAC,CAAC;AAAlD,CAAkD,CAAC;AAErD,MAAM,CAAC,IAAM,oBAAoB,GAAG,UAAC,KAAU,EAAE,KAAY;IAC3D,IAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;QACd,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;KACxB;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,KAAU,EAAE,KAAY;IACrD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE;YACtB,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,GAAuB;IACrD,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,KAAK,SAAS,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,oBAAoB,GAAG,UAAC,GAAW;IAC9C,OAAO,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,UAAU,SAAS,CACvB,IAA2D;IAE3D,OAAO,UAAA,KAAK;QACV,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;YACd,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;gBAC7B,GAAG,CAAC,KAAK,CAAC,CAAC;aACZ;iBAAM,IAAI,GAAG,IAAI,IAAI,EAAE;gBACrB,GAAwC,CAAC,OAAO,GAAG,KAAK,CAAC;aAC3D;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quillsql/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"access": "public",
|
|
5
5
|
"description": "Quill React components for building dashboards and reporting.",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -11,21 +11,16 @@
|
|
|
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",
|
|
15
14
|
"prefix-classnames": "node ./prefix-classnames.js"
|
|
16
15
|
},
|
|
17
16
|
"keywords": [],
|
|
18
17
|
"author": "",
|
|
19
18
|
"license": "ISC",
|
|
20
19
|
"dependencies": {
|
|
21
|
-
"@tremor/react": "^2.1.0",
|
|
22
|
-
"autoprefixer": "^10.4.14",
|
|
23
20
|
"axios": "^1.3.5",
|
|
24
21
|
"date-fns": "^2.29.3",
|
|
25
22
|
"react-loading-skeleton": "^3.2.1",
|
|
26
23
|
"recharts": "^2.5.0",
|
|
27
|
-
"tailwind-merge": "^1.12.0",
|
|
28
|
-
"tailwindcss": "^3.3.1",
|
|
29
24
|
"tslib": "^2.5.0",
|
|
30
25
|
"typescript": "^5.0.3"
|
|
31
26
|
},
|
|
@@ -43,8 +38,6 @@
|
|
|
43
38
|
"eslint-plugin-prettier": "^4.2.1",
|
|
44
39
|
"eslint-plugin-react": "^7.32.2",
|
|
45
40
|
"glob": "^10.2.2",
|
|
46
|
-
"postcss": "^8.4.21",
|
|
47
|
-
"postcss-cli": "^10.1.0",
|
|
48
41
|
"prettier": "^2.8.7"
|
|
49
42
|
}
|
|
50
43
|
}
|