react-science 0.29.0 → 0.30.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-esm/components/button/Button.d.ts.map +1 -1
- package/lib-esm/components/button/Button.js +1 -1
- package/lib-esm/components/button/Button.js.map +1 -1
- package/lib-esm/components/drop-zone/DropZone.d.ts +6 -2
- package/lib-esm/components/drop-zone/DropZone.d.ts.map +1 -1
- package/lib-esm/components/drop-zone/DropZone.js +9 -15
- package/lib-esm/components/drop-zone/DropZone.js.map +1 -1
- package/lib-esm/components/forms/index.d.ts +0 -5
- package/lib-esm/components/forms/index.d.ts.map +1 -1
- package/lib-esm/components/forms/index.js +0 -5
- package/lib-esm/components/forms/index.js.map +1 -1
- package/lib-esm/components/forms/radio-group/RadioGroup.d.ts +1 -0
- package/lib-esm/components/forms/radio-group/RadioGroup.d.ts.map +1 -1
- package/lib-esm/components/forms/radio-group/RadioGroup.js +2 -2
- package/lib-esm/components/forms/radio-group/RadioGroup.js.map +1 -1
- package/lib-esm/components/forms/styles.d.ts +0 -22
- package/lib-esm/components/forms/styles.d.ts.map +1 -1
- package/lib-esm/components/forms/styles.js +0 -72
- package/lib-esm/components/forms/styles.js.map +1 -1
- package/lib-esm/components/index.d.ts +0 -1
- package/lib-esm/components/index.d.ts.map +1 -1
- package/lib-esm/components/index.js +0 -1
- package/lib-esm/components/index.js.map +1 -1
- package/lib-esm/components/info-panel/InfoPanel.d.ts.map +1 -1
- package/lib-esm/components/info-panel/InfoPanel.js +4 -3
- package/lib-esm/components/info-panel/InfoPanel.js.map +1 -1
- package/lib-esm/components/toolbar/Toolbar.js +1 -1
- package/lib-esm/components/toolbar/Toolbar.js.map +1 -1
- package/package.json +2 -1
- package/src/components/button/Button.tsx +9 -3
- package/src/components/drop-zone/DropZone.tsx +42 -25
- package/src/components/forms/index.ts +0 -5
- package/src/components/forms/radio-group/RadioGroup.tsx +3 -0
- package/src/components/forms/styles.ts +0 -92
- package/src/components/index.ts +0 -1
- package/src/components/info-panel/InfoPanel.tsx +5 -2
- package/src/components/toolbar/Toolbar.tsx +1 -1
- package/lib-esm/components/forms/Checkbox.d.ts +0 -11
- package/lib-esm/components/forms/Checkbox.d.ts.map +0 -1
- package/lib-esm/components/forms/Checkbox.js +0 -35
- package/lib-esm/components/forms/Checkbox.js.map +0 -1
- package/lib-esm/components/forms/Input.d.ts +0 -19
- package/lib-esm/components/forms/Input.d.ts.map +0 -1
- package/lib-esm/components/forms/Input.js +0 -60
- package/lib-esm/components/forms/Input.js.map +0 -1
- package/lib-esm/components/forms/Select.d.ts +0 -21
- package/lib-esm/components/forms/Select.d.ts.map +0 -1
- package/lib-esm/components/forms/Select.js +0 -90
- package/lib-esm/components/forms/Select.js.map +0 -1
- package/lib-esm/components/forms/TextArea.d.ts +0 -8
- package/lib-esm/components/forms/TextArea.d.ts.map +0 -1
- package/lib-esm/components/forms/TextArea.js +0 -19
- package/lib-esm/components/forms/TextArea.js.map +0 -1
- package/lib-esm/components/forms/context/FieldsContext.d.ts +0 -16
- package/lib-esm/components/forms/context/FieldsContext.d.ts.map +0 -1
- package/lib-esm/components/forms/context/FieldsContext.js +0 -47
- package/lib-esm/components/forms/context/FieldsContext.js.map +0 -1
- package/lib-esm/components/forms/context/index.d.ts +0 -2
- package/lib-esm/components/forms/context/index.d.ts.map +0 -1
- package/lib-esm/components/forms/context/index.js +0 -2
- package/lib-esm/components/forms/context/index.js.map +0 -1
- package/lib-esm/components/spinner/FullSpinner.d.ts +0 -7
- package/lib-esm/components/spinner/FullSpinner.d.ts.map +0 -1
- package/lib-esm/components/spinner/FullSpinner.js +0 -24
- package/lib-esm/components/spinner/FullSpinner.js.map +0 -1
- package/lib-esm/components/spinner/index.d.ts +0 -2
- package/lib-esm/components/spinner/index.d.ts.map +0 -1
- package/lib-esm/components/spinner/index.js +0 -2
- package/lib-esm/components/spinner/index.js.map +0 -1
- package/src/components/forms/Checkbox.tsx +0 -77
- package/src/components/forms/Input.tsx +0 -144
- package/src/components/forms/Select.tsx +0 -197
- package/src/components/forms/TextArea.tsx +0 -45
- package/src/components/forms/context/FieldsContext.tsx +0 -82
- package/src/components/forms/context/index.ts +0 -1
- package/src/components/spinner/FullSpinner.tsx +0 -57
- package/src/components/spinner/index.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,IAAI,oBAAoB,EACnC,iBAAiB,IAAI,0BAA0B,EAE/C,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,KAAK,cAAc,GAAG;KACnB,GAAG,IAAI,MAAM,oBAAoB,GAChC,MAAM,0BAA0B,CAAC,CAAC,EAAE,oBAAoB,CAAC,GAAG,CAAC,GAC7D,0BAA0B,CAAC,GAAG,CAAC;CAClC,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG;IACzC,YAAY,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;CAC/C,CAAC;AAEF,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,IAAI,oBAAoB,EACnC,iBAAiB,IAAI,0BAA0B,EAE/C,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,KAAK,cAAc,GAAG;KACnB,GAAG,IAAI,MAAM,oBAAoB,GAChC,MAAM,0BAA0B,CAAC,CAAC,EAAE,oBAAoB,CAAC,GAAG,CAAC,GAC7D,0BAA0B,CAAC,GAAG,CAAC;CAClC,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG;IACzC,YAAY,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;CAC/C,CAAC;AAEF,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,2CAiBxC"}
|
|
@@ -5,6 +5,6 @@ export function Button(props) {
|
|
|
5
5
|
const InnerButton = buttonProps.disabled
|
|
6
6
|
? BlueprintAnchorButton
|
|
7
7
|
: BlueprintButton;
|
|
8
|
-
return (_jsx(Tooltip, { fill: tooltipProps?.fill || buttonProps.fill, ...tooltipProps,
|
|
8
|
+
return (_jsx(Tooltip, { fill: tooltipProps?.fill || buttonProps.fill, ...tooltipProps, renderTarget: (targetProps) => (_jsx(InnerButton, { ...targetProps, ...buttonProps, children: children })) }));
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,IAAI,eAAe,EACzB,YAAY,IAAI,qBAAqB,EAGrC,OAAO,GAER,MAAM,mBAAmB,CAAC;AAW3B,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IAEzD,MAAM,WAAW,GAAG,WAAW,CAAC,QAAQ;QACtC,CAAC,CAAC,qBAAqB;QACvB,CAAC,CAAC,eAAe,CAAC;IACpB,OAAO,CACL,KAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,IAAI,eAAe,EACzB,YAAY,IAAI,qBAAqB,EAGrC,OAAO,GAER,MAAM,mBAAmB,CAAC;AAW3B,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IAEzD,MAAM,WAAW,GAAG,WAAW,CAAC,QAAQ;QACtC,CAAC,CAAC,qBAAqB;QACvB,CAAC,CAAC,eAAe,CAAC;IACpB,OAAO,CACL,KAAC,OAAO,IACN,IAAI,EAAE,YAAY,EAAE,IAAI,IAAI,WAAW,CAAC,IAAI,KACxC,YAAY,EAChB,YAAY,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAC7B,KAAC,WAAW,OAAK,WAAW,KAAM,WAAW,YAC1C,QAAQ,GACG,CACf,GACD,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { IconName } from '@blueprintjs/icons';
|
|
2
3
|
import { FileError, FileRejection } from 'react-dropzone';
|
|
3
4
|
export interface DropZoneProps {
|
|
4
|
-
color?: string;
|
|
5
5
|
borderColor?: string;
|
|
6
6
|
onDrop?: <T extends File>(acceptedFiles: T[], rejectedFiles?: FileRejection[]) => void;
|
|
7
7
|
fileValidator?: <T extends File>(file: T) => FileError | FileError[] | null;
|
|
8
|
-
|
|
8
|
+
emptyIcon?: IconName;
|
|
9
|
+
emptyTitle?: string;
|
|
10
|
+
emptyDescription?: string;
|
|
11
|
+
emptyButtonText?: string;
|
|
12
|
+
emptyButtonIcon?: IconName;
|
|
9
13
|
}
|
|
10
14
|
export declare function DropZone(props: DropZoneProps): import("react/jsx-runtime").JSX.Element;
|
|
11
15
|
export interface DropZoneContainerProps extends DropZoneProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropZone.d.ts","sourceRoot":"","sources":["../../../src/components/drop-zone/DropZone.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DropZone.d.ts","sourceRoot":"","sources":["../../../src/components/drop-zone/DropZone.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAInD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAe,MAAM,gBAAgB,CAAC;AAEvE,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,IAAI,EACtB,aAAa,EAAE,CAAC,EAAE,EAClB,aAAa,CAAC,EAAE,aAAa,EAAE,KAC5B,IAAI,CAAC;IACV,aAAa,CAAC,EAAE,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,KAAK,SAAS,GAAG,SAAS,EAAE,GAAG,IAAI,CAAC;IAC5E,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,QAAQ,CAAC;CAC5B;AA0CD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAE5C;AAED,MAAM,WAAW,sBAAuB,SAAQ,aAAa;IAC3D,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;CAC9B;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAE9D"}
|
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { NonIdealState, Button, Colors } from '@blueprintjs/core';
|
|
2
3
|
import styled from '@emotion/styled';
|
|
4
|
+
import { rgba } from 'polished';
|
|
3
5
|
import { useCallback, useMemo } from 'react';
|
|
4
6
|
import { useDropzone } from 'react-dropzone';
|
|
5
|
-
import { FaCloudUploadAlt } from 'react-icons/fa';
|
|
6
7
|
const DropzoneRoot = styled.div `
|
|
7
8
|
position: relative;
|
|
8
9
|
height: 100%;
|
|
9
10
|
width: 100%;
|
|
10
11
|
`;
|
|
11
12
|
const DropzoneDragActive = styled.div `
|
|
12
|
-
font-size: 1.5em;
|
|
13
|
-
font-weight: 600;
|
|
14
13
|
position: absolute;
|
|
15
14
|
top: 0;
|
|
16
15
|
bottom: 0;
|
|
17
16
|
left: 0;
|
|
18
17
|
right: 0;
|
|
19
|
-
|
|
20
|
-
background-color: white;
|
|
18
|
+
background-color: rgb(255, 255, 255, 0.7);
|
|
21
19
|
border: 5px dashed;
|
|
22
20
|
display: flex;
|
|
23
21
|
flex-direction: column;
|
|
24
22
|
align-items: center;
|
|
25
23
|
justify-content: center;
|
|
26
24
|
|
|
27
|
-
border-color: ${({ borderColor }) => borderColor};
|
|
28
|
-
color: ${({ color }) => color};
|
|
25
|
+
border-color: ${({ borderColor }) => borderColor ? rgba(borderColor, 0.7) : ''};
|
|
29
26
|
`;
|
|
30
27
|
const DropzoneEmpty = styled.div `
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
align-items: center;
|
|
35
|
-
justify-content: center;
|
|
28
|
+
:hover .dropzone-button {
|
|
29
|
+
background-color: ${rgba(Colors.BLUE3, 0.15)};
|
|
30
|
+
}
|
|
36
31
|
width: 100%;
|
|
37
32
|
height: 100%;
|
|
38
33
|
padding: 1em;
|
|
@@ -40,7 +35,6 @@ const DropzoneEmpty = styled.div `
|
|
|
40
35
|
cursor: pointer;
|
|
41
36
|
|
|
42
37
|
border-color: ${({ borderColor }) => borderColor};
|
|
43
|
-
color: ${({ color }) => color};
|
|
44
38
|
`;
|
|
45
39
|
export function DropZone(props) {
|
|
46
40
|
return _jsx(DropZoneContent, { ...props });
|
|
@@ -49,7 +43,7 @@ export function DropZoneContainer(props) {
|
|
|
49
43
|
return _jsx(DropZoneContent, { ...props });
|
|
50
44
|
}
|
|
51
45
|
function DropZoneContent(props) {
|
|
52
|
-
const {
|
|
46
|
+
const { borderColor = Colors.GRAY3, children = null, onDrop, onClick, fileValidator, emptyIcon = 'import', emptyTitle = 'No data loaded', emptyDescription = 'You can load data by drag-and-dropping files here', emptyButtonText = 'Select files', emptyButtonIcon = 'plus', } = props;
|
|
53
47
|
const hasChildren = children !== null;
|
|
54
48
|
const handleOnDrop = useCallback((acceptedFiles, rejectedFiles) => {
|
|
55
49
|
onDrop?.(acceptedFiles, rejectedFiles);
|
|
@@ -64,6 +58,6 @@ function DropZoneContent(props) {
|
|
|
64
58
|
return { onClick };
|
|
65
59
|
}
|
|
66
60
|
}, [onClick]);
|
|
67
|
-
return (_jsxs(DropzoneRoot, { ...getRootProps(getPropsOptions), children: [children, isDragActive ? (
|
|
61
|
+
return (_jsxs(DropzoneRoot, { ...getRootProps(getPropsOptions), children: [children, isDragActive ? (_jsx(DropzoneDragActive, { borderColor: borderColor, children: _jsx(NonIdealState, { icon: "cloud-upload", title: "Drop the files here" }) })) : !hasChildren ? (_jsx(DropzoneEmpty, { borderColor: borderColor, children: _jsx(NonIdealState, { icon: emptyIcon, title: emptyTitle, description: emptyDescription, action: _jsx(Button, { className: "dropzone-button", outlined: true, text: emptyButtonText, icon: emptyButtonIcon, intent: "primary" }) }) })) : null, _jsx("input", { ...getInputProps() })] }));
|
|
68
62
|
}
|
|
69
63
|
//# sourceMappingURL=DropZone.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropZone.js","sourceRoot":"","sources":["../../../src/components/drop-zone/DropZone.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"DropZone.js","sourceRoot":"","sources":["../../../src/components/drop-zone/DropZone.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAoC,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,EAA4B,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAgBvE,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAI9B,CAAC;AAMF,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAoB;;;;;;;;;;;;;kBAavC,CAAC,EAAE,WAAW,EAAE,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,IAAI,OAAO,EAAE;YACX,OAAO,EAAE,OAAO,EAAE,CAAC;SACpB;IACH,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,CACL,MAAC,YAAY,OAAK,YAAY,CAAC,eAAe,CAAC,aAC5C,QAAQ,EACR,YAAY,CAAC,CAAC,CAAC,CACd,KAAC,kBAAkB,IAAC,WAAW,EAAE,WAAW,YAC1C,KAAC,aAAa,IAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,qBAAqB,GAAG,GAC9C,CACtB,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CACjB,KAAC,aAAa,IAAC,WAAW,EAAE,WAAW,YACrC,KAAC,aAAa,IACZ,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,gBAAgB,EAC7B,MAAM,EACJ,KAAC,MAAM,IACL,SAAS,EAAC,iBAAiB,EAC3B,QAAQ,QACR,IAAI,EAAE,eAAe,EACrB,IAAI,EAAE,eAAe,EACrB,MAAM,EAAC,SAAS,GAChB,GAEJ,GACY,CACjB,CAAC,CAAC,CAAC,IAAI,EACR,mBAAW,aAAa,EAAE,GAAI,IACjB,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -13,6 +13,7 @@ export interface RadioGroupProps {
|
|
|
13
13
|
name?: string;
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
variant?: InputVariant;
|
|
16
|
+
id?: string;
|
|
16
17
|
}
|
|
17
18
|
export declare function RadioGroup(props: RadioGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
18
19
|
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/radio-group/RadioGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAKzC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/radio-group/RadioGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAKzC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAkBD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,oDA2ChD"}
|
|
@@ -21,8 +21,8 @@ const rootStyles = {
|
|
|
21
21
|
}),
|
|
22
22
|
};
|
|
23
23
|
export function RadioGroup(props) {
|
|
24
|
-
const { selected, type = 'classic', disabled: groupDisabled = false, options = [], onSelect, name = '', variant = 'default', } = props;
|
|
25
|
-
return (_jsx(RadioGroupRadix.Root, { css: [
|
|
24
|
+
const { id, selected, type = 'classic', disabled: groupDisabled = false, options = [], onSelect, name = '', variant = 'default', } = props;
|
|
25
|
+
return (_jsx(RadioGroupRadix.Root, { id: id, css: [
|
|
26
26
|
rootStyles.basic,
|
|
27
27
|
type === 'classic' ? null : rootStyles.button(variant),
|
|
28
28
|
], style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../../src/components/forms/radio-group/RadioGroup.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAK/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sourceRoot":"","s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AAS,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC/D,EACD,KAAK,EAAE,QAAQ,EAAE,KAAK,EACtB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,aAAa,YAEtB,OAAO,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC3C,MAAM,UAAU,GAAG;gBACjB,GAAG,EAAE,KAAK;gBACV,KAAK;gBACL,KAAK;gBACL,QAAQ,EAAE,aAAa,IAAI,QAAQ;gBACnC,QAAQ;gBACR,OAAO;gBACP,IAAI;aACL,CAAC;YACF,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAC1B,KAAC,gBAAgB,OAAK,UAAU,GAAI,CACrC,CAAC,CAAC,CAAC,CACF,KAAC,eAAe,OAAK,UAAU,GAAI,CACpC,CAAC;QACJ,CAAC,CAAC,GACmB,CACxB,CAAC;AACJ,CAAC"}
|
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export type InputVariant = 'default' | 'small';
|
|
3
|
-
interface StyledProps {
|
|
4
|
-
variant: InputVariant;
|
|
5
|
-
hasLeading?: boolean;
|
|
6
|
-
hasTrailing?: boolean;
|
|
7
|
-
}
|
|
8
2
|
export declare const enabledColor = "#1677ff";
|
|
9
3
|
export declare const disabledColor = "#b8b8b8";
|
|
10
|
-
export declare const LabelStyled: import("@emotion/styled").StyledComponent<{
|
|
11
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
-
as?: import("react").ElementType<any> | undefined;
|
|
13
|
-
} & StyledProps, import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {}>;
|
|
14
|
-
export declare const GroupStyled: import("@emotion/styled").StyledComponent<{
|
|
15
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
16
|
-
as?: import("react").ElementType<any> | undefined;
|
|
17
|
-
} & {
|
|
18
|
-
hasError: boolean;
|
|
19
|
-
hasValid: boolean;
|
|
20
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
21
|
-
export declare const InputContainer: import("@emotion/styled").StyledComponent<{
|
|
22
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
23
|
-
as?: import("react").ElementType<any> | undefined;
|
|
24
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
25
|
-
export {};
|
|
26
4
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/forms/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/forms/styles.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;AAE/C,eAAO,MAAM,YAAY,YAAY,CAAC;AACtC,eAAO,MAAM,aAAa,YAAY,CAAC"}
|
|
@@ -1,75 +1,3 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
1
|
export const enabledColor = '#1677ff';
|
|
3
2
|
export const disabledColor = '#b8b8b8';
|
|
4
|
-
export const LabelStyled = styled.label `
|
|
5
|
-
padding: ${(props) => props.variant === 'default'
|
|
6
|
-
? props.hasTrailing
|
|
7
|
-
? '2px 9px 4px 9px'
|
|
8
|
-
: '2px 9px'
|
|
9
|
-
: props.hasTrailing
|
|
10
|
-
? '1px 7px 1px 7px'
|
|
11
|
-
: '1px 7px'};
|
|
12
|
-
|
|
13
|
-
font-size: ${(props) => (props.variant === 'small' ? '1em' : '1.125em')};
|
|
14
|
-
line-height: '17px';
|
|
15
|
-
|
|
16
|
-
background-color: white;
|
|
17
|
-
border-width: 1px;
|
|
18
|
-
align-items: center;
|
|
19
|
-
flex-direction: row;
|
|
20
|
-
flex: 1 1 0%;
|
|
21
|
-
display: flex;
|
|
22
|
-
position: relative;
|
|
23
|
-
|
|
24
|
-
border-top-right-radius: ${(props) => props.hasLeading && !props.hasTrailing && '0.375rem'};
|
|
25
|
-
|
|
26
|
-
border-bottom-right-radius: ${(props) => props.hasLeading && !props.hasTrailing && '0.375rem'};
|
|
27
|
-
|
|
28
|
-
border-top-left-radius: ${(props) => props.hasTrailing && !props.hasLeading && '0.375rem'};
|
|
29
|
-
|
|
30
|
-
border-bottom-left-radius: ${(props) => props.hasTrailing && !props.hasLeading && '0.375rem'};
|
|
31
|
-
|
|
32
|
-
border-radius: ${(props) => !props.hasLeading && !props.hasTrailing && '0.375rem'};
|
|
33
|
-
|
|
34
|
-
border-color: var(--custom-border-color);
|
|
35
|
-
`;
|
|
36
|
-
function getStyleColor(hasError, hasValid) {
|
|
37
|
-
if (hasError) {
|
|
38
|
-
return {
|
|
39
|
-
default: '#ffa39e',
|
|
40
|
-
hover: '#f95d55',
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
if (hasValid) {
|
|
44
|
-
return {
|
|
45
|
-
default: '#6adc24',
|
|
46
|
-
hover: '#62cb21',
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
default: 'rgb(217, 217, 217)',
|
|
51
|
-
hover: '#4096ff',
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export const GroupStyled = styled.div `
|
|
55
|
-
display: flex;
|
|
56
|
-
border-radius: 0.375rem;
|
|
57
|
-
margin-top: 0.25rem;
|
|
58
|
-
|
|
59
|
-
.addon {
|
|
60
|
-
color: ${({ hasError }) => hasError && '#f95d55'};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
--custom-border-color: ${({ hasError, hasValid }) => getStyleColor(hasError, hasValid).default};
|
|
64
|
-
|
|
65
|
-
:hover,
|
|
66
|
-
:focus-within {
|
|
67
|
-
--custom-border-color: ${({ hasError, hasValid }) => getStyleColor(hasError, hasValid).hover};
|
|
68
|
-
}
|
|
69
|
-
`;
|
|
70
|
-
export const InputContainer = styled.div `
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-direction: column;
|
|
73
|
-
gap: 2px;
|
|
74
|
-
`;
|
|
75
3
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/forms/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/forms/styles.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC"}
|
|
@@ -10,7 +10,6 @@ export * from './info-panel/index';
|
|
|
10
10
|
export * from './layout-manager/index';
|
|
11
11
|
export * from './modal/index';
|
|
12
12
|
export * from './root-layout/index';
|
|
13
|
-
export * from './spinner/index';
|
|
14
13
|
export * from './split-pane/index';
|
|
15
14
|
export * from './table/index';
|
|
16
15
|
export * from './tabs/index';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,OAAO,KAAK,cAAc,MAAM,yBAAyB,CAAC"}
|
|
@@ -10,7 +10,6 @@ export * from './info-panel/index';
|
|
|
10
10
|
export * from './layout-manager/index';
|
|
11
11
|
export * from './modal/index';
|
|
12
12
|
export * from './root-layout/index';
|
|
13
|
-
export * from './spinner/index';
|
|
14
13
|
export * from './split-pane/index';
|
|
15
14
|
export * from './table/index';
|
|
16
15
|
export * from './tabs/index';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,OAAO,KAAK,cAAc,MAAM,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoPanel.d.ts","sourceRoot":"","sources":["../../../src/components/info-panel/InfoPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InfoPanel.d.ts","sourceRoot":"","sources":["../../../src/components/info-panel/InfoPanel.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAMhD,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,GAAG,CAAC,CAAC;CAChE;AAED,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAwBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,oDAkF9C"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { InputGroup } from '@blueprintjs/core';
|
|
3
4
|
import { css } from '@emotion/react';
|
|
4
5
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error
|
|
5
6
|
// @ts-ignore
|
|
6
7
|
import { Disclosure } from '@headlessui/react';
|
|
7
8
|
import { useState } from 'react';
|
|
8
9
|
import { FaChevronRight } from 'react-icons/fa';
|
|
9
|
-
import {
|
|
10
|
+
import { ValueRenderers } from '../index';
|
|
10
11
|
import { Table } from '../table/Table';
|
|
11
12
|
const style = {
|
|
12
13
|
container: css({
|
|
@@ -57,10 +58,10 @@ export function InfoPanel(props) {
|
|
|
57
58
|
}
|
|
58
59
|
return [...exactMatch, ...startsWith, ...includes, ...valueContains].map(([key, value]) => (_jsxs(Table.Row, { children: [_jsx(ValueRenderers.Text, { value: key }), valueCell(value)] }, key)));
|
|
59
60
|
}
|
|
60
|
-
return (_jsxs("div", { css: style.container, children: [_jsx("div", { style: titleStyle, children: title }), _jsx(
|
|
61
|
+
return (_jsxs("div", { css: style.container, children: [_jsx("div", { style: titleStyle, children: title }), _jsx(InputGroup, { placeholder: "search for a parameter ...", value: search, onChange: ({ target }) => {
|
|
61
62
|
if (target.value !== undefined)
|
|
62
63
|
setSearch(target.value);
|
|
63
|
-
}, style: inputStyle }), data.map(({ description, data }) => {
|
|
64
|
+
}, style: inputStyle, leftIcon: "search", type: "search" }), data.map(({ description, data }) => {
|
|
64
65
|
const content = viewData(data);
|
|
65
66
|
return content.length > 0 ? (_jsx(Disclosure, { defaultOpen: true, children: ({ open }) => (_jsxs(_Fragment, { children: [_jsxs(Disclosure.Button, { css: style.button, children: [_jsx(FaChevronRight, { css: style.chevron(open) }), description] }), _jsx(Disclosure.Panel, { children: _jsxs(Table, { css: style.table, style: tableStyle, children: [_jsxs(Table.Header, { children: [_jsx(ValueRenderers.Title, { value: "Parameter" }), _jsx(ValueRenderers.Title, { value: "Value" })] }), content] }) })] })) }, description)) : null;
|
|
66
67
|
})] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoPanel.js","sourceRoot":"","sources":["../../../src/components/info-panel/InfoPanel.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,wGAAwG;AACxG,aAAa;AACb,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAiB,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"InfoPanel.js","sourceRoot":"","sources":["../../../src/components/info-panel/InfoPanel.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,wGAAwG;AACxG,aAAa;AACb,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAiB,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAcvC,MAAM,KAAK,GAAG;IACZ,SAAS,EAAE,GAAG,CAAC;QACb,OAAO,EAAE,KAAK;KACf,CAAC;IACF,OAAO,EAAE,CAAC,IAAa,EAAE,EAAE,CACzB,GAAG,CAAC;QACF,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;QAC/B,UAAU,EAAE,sBAAsB;KACnC,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,CAAC,CAAC;QACxC,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAChD,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAChC;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC"}
|
|
@@ -47,7 +47,7 @@ Toolbar.Item = function ToolbarItem(props) {
|
|
|
47
47
|
.${Classes.ICON} {
|
|
48
48
|
color: ${Colors.DARK_GRAY3};
|
|
49
49
|
}
|
|
50
|
-
`, intent: intent, style: { position: 'relative', fontSize: '1.25em' }, type: "button", active: active, icon: icon, onClick: () => {
|
|
50
|
+
`, intent: intent, style: { position: 'relative', fontSize: '1.25em', width: 'auto' }, type: "button", active: active, icon: icon, onClick: () => {
|
|
51
51
|
if (onClick) {
|
|
52
52
|
onClick(props);
|
|
53
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EACL,WAAW,EAEX,OAAO,EACP,MAAM,GAEP,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAGL,eAAe,EACf,OAAO,EACP,MAAM,GACP,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAEL,cAAc,EACd,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAwB1B,MAAM,MAAM,GAAG,8BAA8B,CAAC;AAE9C,MAAM,UAAU,OAAO,CAAC,KAAmB;IACzC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE9D,MAAM,YAAY,GAAG,OAAO,CAC1B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AC,CAAC;aAChB;QACH,CAAC,EACD,YAAY,EAAE;YACZ,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;YACxC,MAAM;YACN,OAAO,EAAE,CAAC,KAAK;SAChB,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,eAAe,CAAC,KAGxB;IACC,OAAO,CACL,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,YACxC,KAAK,CAAC,QAAQ,GACS,CAC3B,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-science",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "React components to build scientific applications UI",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./app": {
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"react-dom": ">=18.0.0"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
+
"@blueprintjs/select": "^5.0.19",
|
|
63
64
|
"@emotion/react": "^11.11.1",
|
|
64
65
|
"@emotion/styled": "^11.11.0",
|
|
65
66
|
"@headlessui/react": "^1.7.17",
|
|
@@ -23,8 +23,14 @@ export function Button(props: ButtonProps) {
|
|
|
23
23
|
? BlueprintAnchorButton
|
|
24
24
|
: BlueprintButton;
|
|
25
25
|
return (
|
|
26
|
-
<Tooltip
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
<Tooltip
|
|
27
|
+
fill={tooltipProps?.fill || buttonProps.fill}
|
|
28
|
+
{...tooltipProps}
|
|
29
|
+
renderTarget={(targetProps) => (
|
|
30
|
+
<InnerButton {...targetProps} {...buttonProps}>
|
|
31
|
+
{children}
|
|
32
|
+
</InnerButton>
|
|
33
|
+
)}
|
|
34
|
+
/>
|
|
29
35
|
);
|
|
30
36
|
}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
+
import { NonIdealState, Button, Colors } from '@blueprintjs/core';
|
|
2
|
+
import type { IconName } from '@blueprintjs/icons';
|
|
1
3
|
import styled from '@emotion/styled';
|
|
4
|
+
import { rgba } from 'polished';
|
|
2
5
|
import { CSSProperties, MouseEventHandler, useCallback, useMemo } from 'react';
|
|
3
6
|
import { FileError, FileRejection, useDropzone } from 'react-dropzone';
|
|
4
|
-
import { FaCloudUploadAlt } from 'react-icons/fa';
|
|
5
7
|
|
|
6
8
|
export interface DropZoneProps {
|
|
7
|
-
color?: string;
|
|
8
9
|
borderColor?: string;
|
|
9
10
|
onDrop?: <T extends File>(
|
|
10
11
|
acceptedFiles: T[],
|
|
11
12
|
rejectedFiles?: FileRejection[],
|
|
12
13
|
) => void;
|
|
13
14
|
fileValidator?: <T extends File>(file: T) => FileError | FileError[] | null;
|
|
14
|
-
|
|
15
|
+
emptyIcon?: IconName;
|
|
16
|
+
emptyTitle?: string;
|
|
17
|
+
emptyDescription?: string;
|
|
18
|
+
emptyButtonText?: string;
|
|
19
|
+
emptyButtonIcon?: IconName;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
const DropzoneRoot = styled.div`
|
|
@@ -22,35 +27,29 @@ const DropzoneRoot = styled.div`
|
|
|
22
27
|
|
|
23
28
|
interface DropzoneColorProps {
|
|
24
29
|
borderColor: CSSProperties['borderColor'];
|
|
25
|
-
color: CSSProperties['color'];
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
const DropzoneDragActive = styled.div<DropzoneColorProps>`
|
|
29
|
-
font-size: 1.5em;
|
|
30
|
-
font-weight: 600;
|
|
31
33
|
position: absolute;
|
|
32
34
|
top: 0;
|
|
33
35
|
bottom: 0;
|
|
34
36
|
left: 0;
|
|
35
37
|
right: 0;
|
|
36
|
-
|
|
37
|
-
background-color: white;
|
|
38
|
+
background-color: rgb(255, 255, 255, 0.7);
|
|
38
39
|
border: 5px dashed;
|
|
39
40
|
display: flex;
|
|
40
41
|
flex-direction: column;
|
|
41
42
|
align-items: center;
|
|
42
43
|
justify-content: center;
|
|
43
44
|
|
|
44
|
-
border-color: ${({ borderColor }) =>
|
|
45
|
-
|
|
45
|
+
border-color: ${({ borderColor }) =>
|
|
46
|
+
borderColor ? rgba(borderColor, 0.7) : ''};
|
|
46
47
|
`;
|
|
47
48
|
|
|
48
49
|
const DropzoneEmpty = styled.div<DropzoneColorProps>`
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
align-items: center;
|
|
53
|
-
justify-content: center;
|
|
50
|
+
:hover .dropzone-button {
|
|
51
|
+
background-color: ${rgba(Colors.BLUE3, 0.15)};
|
|
52
|
+
}
|
|
54
53
|
width: 100%;
|
|
55
54
|
height: 100%;
|
|
56
55
|
padding: 1em;
|
|
@@ -58,7 +57,6 @@ const DropzoneEmpty = styled.div<DropzoneColorProps>`
|
|
|
58
57
|
cursor: pointer;
|
|
59
58
|
|
|
60
59
|
border-color: ${({ borderColor }) => borderColor};
|
|
61
|
-
color: ${({ color }) => color};
|
|
62
60
|
`;
|
|
63
61
|
|
|
64
62
|
export function DropZone(props: DropZoneProps) {
|
|
@@ -77,17 +75,24 @@ function DropZoneContent(
|
|
|
77
75
|
props: DropZoneProps & {
|
|
78
76
|
children?: JSX.Element | null;
|
|
79
77
|
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
80
|
-
|
|
78
|
+
emptyIcon?: IconName;
|
|
79
|
+
emptyTitle?: string;
|
|
80
|
+
emptyDescription?: string;
|
|
81
|
+
emptyButtonText?: string;
|
|
82
|
+
emptyButtonIcon?: IconName;
|
|
81
83
|
},
|
|
82
84
|
) {
|
|
83
85
|
const {
|
|
84
|
-
|
|
85
|
-
borderColor = 'gray',
|
|
86
|
+
borderColor = Colors.GRAY3,
|
|
86
87
|
children = null,
|
|
87
88
|
onDrop,
|
|
88
|
-
emptyText = 'Click or drag and drop to add data.',
|
|
89
89
|
onClick,
|
|
90
90
|
fileValidator,
|
|
91
|
+
emptyIcon = 'import',
|
|
92
|
+
emptyTitle = 'No data loaded',
|
|
93
|
+
emptyDescription = 'You can load data by drag-and-dropping files here',
|
|
94
|
+
emptyButtonText = 'Select files',
|
|
95
|
+
emptyButtonIcon = 'plus',
|
|
91
96
|
} = props;
|
|
92
97
|
|
|
93
98
|
const hasChildren = children !== null;
|
|
@@ -115,13 +120,25 @@ function DropZoneContent(
|
|
|
115
120
|
<DropzoneRoot {...getRootProps(getPropsOptions)}>
|
|
116
121
|
{children}
|
|
117
122
|
{isDragActive ? (
|
|
118
|
-
<DropzoneDragActive borderColor={borderColor}
|
|
119
|
-
<
|
|
120
|
-
<p>Drop the files here.</p>
|
|
123
|
+
<DropzoneDragActive borderColor={borderColor}>
|
|
124
|
+
<NonIdealState icon="cloud-upload" title="Drop the files here" />
|
|
121
125
|
</DropzoneDragActive>
|
|
122
126
|
) : !hasChildren ? (
|
|
123
|
-
<DropzoneEmpty borderColor={borderColor}
|
|
124
|
-
|
|
127
|
+
<DropzoneEmpty borderColor={borderColor}>
|
|
128
|
+
<NonIdealState
|
|
129
|
+
icon={emptyIcon}
|
|
130
|
+
title={emptyTitle}
|
|
131
|
+
description={emptyDescription}
|
|
132
|
+
action={
|
|
133
|
+
<Button
|
|
134
|
+
className="dropzone-button"
|
|
135
|
+
outlined
|
|
136
|
+
text={emptyButtonText}
|
|
137
|
+
icon={emptyButtonIcon}
|
|
138
|
+
intent="primary"
|
|
139
|
+
/>
|
|
140
|
+
}
|
|
141
|
+
/>
|
|
125
142
|
</DropzoneEmpty>
|
|
126
143
|
) : null}
|
|
127
144
|
<input {...getInputProps()} />
|