react-science 0.35.0 → 0.36.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/components/button/Button.d.ts +6 -2
- package/lib/components/button/Button.d.ts.map +1 -1
- package/lib/components/button/Button.js +17 -3
- package/lib/components/button/Button.js.map +1 -1
- package/lib/components/forms/radio-group/RadioGroup.d.ts +0 -1
- package/lib/components/forms/radio-group/RadioGroup.d.ts.map +1 -1
- package/lib/components/forms/radio-group/RadioGroup.js +4 -9
- package/lib/components/forms/radio-group/RadioGroup.js.map +1 -1
- package/lib/components/hooks/index.d.ts +1 -0
- package/lib/components/hooks/index.d.ts.map +1 -1
- package/lib/components/hooks/index.js +1 -0
- package/lib/components/hooks/index.js.map +1 -1
- package/lib/components/hooks/useSelect.d.ts +21 -0
- package/lib/components/hooks/useSelect.d.ts.map +1 -0
- package/lib/components/hooks/useSelect.js +45 -0
- package/lib/components/hooks/useSelect.js.map +1 -0
- package/lib/components/toolbar/Toolbar.d.ts +5 -1
- package/lib/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/components/toolbar/Toolbar.js +4 -4
- package/lib/components/toolbar/Toolbar.js.map +1 -1
- package/lib/components/toolbar/toolbarContext.d.ts +2 -0
- package/lib/components/toolbar/toolbarContext.d.ts.map +1 -1
- package/lib/components/toolbar/toolbarContext.js.map +1 -1
- package/lib-esm/components/button/Button.d.ts +6 -2
- package/lib-esm/components/button/Button.d.ts.map +1 -1
- package/lib-esm/components/button/Button.js +18 -4
- package/lib-esm/components/button/Button.js.map +1 -1
- package/lib-esm/components/forms/radio-group/RadioGroup.d.ts +0 -1
- package/lib-esm/components/forms/radio-group/RadioGroup.d.ts.map +1 -1
- package/lib-esm/components/forms/radio-group/RadioGroup.js +4 -9
- package/lib-esm/components/forms/radio-group/RadioGroup.js.map +1 -1
- package/lib-esm/components/hooks/index.d.ts +1 -0
- package/lib-esm/components/hooks/index.d.ts.map +1 -1
- package/lib-esm/components/hooks/index.js +1 -0
- package/lib-esm/components/hooks/index.js.map +1 -1
- package/lib-esm/components/hooks/useSelect.d.ts +21 -0
- package/lib-esm/components/hooks/useSelect.d.ts.map +1 -0
- package/lib-esm/components/hooks/useSelect.js +41 -0
- package/lib-esm/components/hooks/useSelect.js.map +1 -0
- package/lib-esm/components/toolbar/Toolbar.d.ts +5 -1
- package/lib-esm/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib-esm/components/toolbar/Toolbar.js +4 -4
- package/lib-esm/components/toolbar/Toolbar.js.map +1 -1
- package/lib-esm/components/toolbar/toolbarContext.d.ts +2 -0
- package/lib-esm/components/toolbar/toolbarContext.d.ts.map +1 -1
- package/lib-esm/components/toolbar/toolbarContext.js.map +1 -1
- package/package.json +27 -27
- package/src/components/button/Button.tsx +35 -4
- package/src/components/forms/radio-group/RadioGroup.tsx +3 -14
- package/src/components/hooks/index.ts +1 -0
- package/src/components/hooks/useSelect.tsx +58 -0
- package/src/components/toolbar/Toolbar.tsx +23 -4
- package/src/components/toolbar/toolbarContext.ts +3 -0
- package/lib/components/forms/radio-group/ClassicRadioItem.d.ts +0 -3
- package/lib/components/forms/radio-group/ClassicRadioItem.d.ts.map +0 -1
- package/lib/components/forms/radio-group/ClassicRadioItem.js +0 -92
- package/lib/components/forms/radio-group/ClassicRadioItem.js.map +0 -1
- package/lib-esm/components/forms/radio-group/ClassicRadioItem.d.ts +0 -3
- package/lib-esm/components/forms/radio-group/ClassicRadioItem.d.ts.map +0 -1
- package/lib-esm/components/forms/radio-group/ClassicRadioItem.js +0 -65
- package/lib-esm/components/forms/radio-group/ClassicRadioItem.js.map +0 -1
- package/src/components/forms/radio-group/ClassicRadioItem.tsx +0 -94
|
@@ -7,8 +7,8 @@ import { Button } from '../index';
|
|
|
7
7
|
import { toolbarContext, useToolbarContext, } from './toolbarContext';
|
|
8
8
|
const border = '1px solid rgb(247, 247, 247)';
|
|
9
9
|
export function Toolbar(props) {
|
|
10
|
-
const { children, disabled, intent, large, vertical } = props;
|
|
11
|
-
const contextValue = useMemo(() => ({ intent, large, vertical, disabled }), [intent, large, vertical, disabled]);
|
|
10
|
+
const { children, disabled, intent, large, vertical, popoverInteractionKind, } = props;
|
|
11
|
+
const contextValue = useMemo(() => ({ intent, large, vertical, disabled, popoverInteractionKind }), [intent, large, vertical, disabled, popoverInteractionKind]);
|
|
12
12
|
const ref = useRef(null);
|
|
13
13
|
// Work around wrong width on vertical flex when wrapping
|
|
14
14
|
// In Chrome: recently fixed (https://bugs.chromium.org/p/chromium/issues/detail?id=507397)
|
|
@@ -91,8 +91,8 @@ Toolbar.Item = function ToolbarItem(props) {
|
|
|
91
91
|
};
|
|
92
92
|
Toolbar.PopoverItem = function ToolbarPopoverItem(props) {
|
|
93
93
|
const { itemProps, ...other } = props;
|
|
94
|
-
const { disabled, vertical } = useToolbarContext();
|
|
95
|
-
return (_jsx(Popover, { minimal: true, disabled: disabled, placement: vertical ? 'right-start' : 'bottom-start', css: css `
|
|
94
|
+
const { disabled, vertical, popoverInteractionKind } = useToolbarContext();
|
|
95
|
+
return (_jsx(Popover, { minimal: true, disabled: disabled, placement: vertical ? 'right-start' : 'bottom-start', interactionKind: popoverInteractionKind, hoverCloseDelay: 0, css: css `
|
|
96
96
|
.${Classes.ICON} {
|
|
97
97
|
color: ${Colors.DARK_GRAY3};
|
|
98
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EACL,WAAW,EACX,OAAO,EACP,MAAM,EAEN,OAAO,
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EACL,WAAW,EACX,OAAO,EACP,MAAM,EAEN,OAAO,EAGP,IAAI,GACL,MAAM,mBAAmB,CAAC;AAE3B,OAAO,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Q,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,YACxC,KAAK,CAAC,QAAQ,GACS,CAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Intent } from '@blueprintjs/core';
|
|
3
|
+
import { PopoverInteractionType } from './Toolbar';
|
|
3
4
|
export interface ToolbarContext {
|
|
4
5
|
intent?: Intent;
|
|
5
6
|
large?: boolean;
|
|
6
7
|
vertical?: boolean;
|
|
7
8
|
disabled?: boolean;
|
|
9
|
+
popoverInteractionKind?: PopoverInteractionType;
|
|
8
10
|
}
|
|
9
11
|
export declare const toolbarContext: import("react").Context<ToolbarContext | null>;
|
|
10
12
|
export declare function useToolbarContext(): ToolbarContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarContext.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/toolbarContext.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"toolbarContext.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/toolbarContext.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACjD;AAED,eAAO,MAAM,cAAc,gDAA6C,CAAC;AAEzE,wBAAgB,iBAAiB,mBAQhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbarContext.js","sourceRoot":"","sources":["../../../src/components/toolbar/toolbarContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"toolbarContext.js","sourceRoot":"","sources":["../../../src/components/toolbar/toolbarContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAYlD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAwB,IAAI,CAAC,CAAC;AAEzE,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IACvC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-science",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "React components to build scientific applications UI",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./app": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"test-only": "vitest run --coverage "
|
|
52
52
|
},
|
|
53
53
|
"volta": {
|
|
54
|
-
"node": "20.11.
|
|
54
|
+
"node": "20.11.1"
|
|
55
55
|
},
|
|
56
56
|
"overrides": {
|
|
57
57
|
"react": "^18.2.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"react-dom": ">=18.0.0"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@blueprintjs/select": "^5.
|
|
67
|
+
"@blueprintjs/select": "^5.1.1",
|
|
68
68
|
"@emotion/react": "^11.11.3",
|
|
69
69
|
"@emotion/styled": "^11.11.0",
|
|
70
70
|
"@headlessui/react": "^1.7.18",
|
|
@@ -73,20 +73,20 @@
|
|
|
73
73
|
"@radix-ui/react-checkbox": "^1.0.4",
|
|
74
74
|
"@radix-ui/react-radio-group": "^1.1.3",
|
|
75
75
|
"@radix-ui/react-select": "^2.0.0",
|
|
76
|
-
"@tanstack/react-query": "^5.
|
|
77
|
-
"@tanstack/react-table": "^8.
|
|
76
|
+
"@tanstack/react-query": "^5.21.7",
|
|
77
|
+
"@tanstack/react-table": "^8.12.0",
|
|
78
78
|
"biologic-converter": "^0.6.0",
|
|
79
79
|
"cheminfo-types": "^1.7.2",
|
|
80
80
|
"d3-scale-chromatic": "^3.0.0",
|
|
81
81
|
"filelist-utils": "^1.11.0",
|
|
82
82
|
"immer": "^10.0.3",
|
|
83
|
-
"jcampconverter": "^9.6.
|
|
83
|
+
"jcampconverter": "^9.6.1",
|
|
84
84
|
"lodash": "^4.17.21",
|
|
85
85
|
"ml-gsd": "^12.1.3",
|
|
86
86
|
"ml-peak-shape-generator": "^4.1.2",
|
|
87
87
|
"ml-signal-processing": "^1.0.3",
|
|
88
|
-
"ml-spectra-processing": "^12.
|
|
89
|
-
"ms-spectrum": "^3.4.
|
|
88
|
+
"ml-spectra-processing": "^12.10.2",
|
|
89
|
+
"ms-spectrum": "^3.4.2",
|
|
90
90
|
"netcdfjs": "^3.0.0",
|
|
91
91
|
"react-d3-utils": "^1.0.0",
|
|
92
92
|
"react-dropzone": "^14.2.3",
|
|
@@ -102,41 +102,41 @@
|
|
|
102
102
|
"wdf-parser": "^0.3.0"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
|
-
"@babel/core": "^7.23.
|
|
106
|
-
"@babel/eslint-parser": "^7.23.
|
|
105
|
+
"@babel/core": "^7.23.9",
|
|
106
|
+
"@babel/eslint-parser": "^7.23.10",
|
|
107
107
|
"@babel/preset-react": "^7.23.3",
|
|
108
|
-
"@blueprintjs/core": "^5.
|
|
109
|
-
"@blueprintjs/icons": "^5.7.
|
|
110
|
-
"@playwright/experimental-ct-react": "^1.41.
|
|
111
|
-
"@playwright/test": "^1.41.
|
|
112
|
-
"@storybook/addon-essentials": "7.6.
|
|
113
|
-
"@storybook/addon-storysource": "7.6.
|
|
114
|
-
"@storybook/blocks": "7.6.
|
|
115
|
-
"@storybook/react": "7.6.
|
|
116
|
-
"@storybook/react-vite": "7.6.
|
|
108
|
+
"@blueprintjs/core": "^5.9.1",
|
|
109
|
+
"@blueprintjs/icons": "^5.7.1",
|
|
110
|
+
"@playwright/experimental-ct-react": "^1.41.2",
|
|
111
|
+
"@playwright/test": "^1.41.2",
|
|
112
|
+
"@storybook/addon-essentials": "7.6.16",
|
|
113
|
+
"@storybook/addon-storysource": "7.6.16",
|
|
114
|
+
"@storybook/blocks": "7.6.16",
|
|
115
|
+
"@storybook/react": "7.6.16",
|
|
116
|
+
"@storybook/react-vite": "7.6.16",
|
|
117
117
|
"@types/babel__core": "^7.20.5",
|
|
118
118
|
"@types/d3-scale-chromatic": "^3.0.3",
|
|
119
119
|
"@types/lodash": "^4.14.202",
|
|
120
|
-
"@types/react": "^18.2.
|
|
121
|
-
"@types/react-dom": "^18.2.
|
|
120
|
+
"@types/react": "^18.2.56",
|
|
121
|
+
"@types/react-dom": "^18.2.19",
|
|
122
122
|
"@types/react-inspector": "^4.0.6",
|
|
123
123
|
"@types/tinycolor2": "^1.4.6",
|
|
124
124
|
"@vitejs/plugin-react": "^4.2.1",
|
|
125
|
-
"@vitest/coverage-v8": "^1.
|
|
125
|
+
"@vitest/coverage-v8": "^1.3.0",
|
|
126
126
|
"cheminfo-font": "^1.13.0",
|
|
127
127
|
"cross-env": "^7.0.3",
|
|
128
128
|
"eslint": "^8.56.0",
|
|
129
129
|
"eslint-config-zakodium": "^8.1.0",
|
|
130
|
-
"eslint-plugin-storybook": "^0.
|
|
131
|
-
"prettier": "^3.2.
|
|
130
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
131
|
+
"prettier": "^3.2.5",
|
|
132
132
|
"react": "^18.2.0",
|
|
133
133
|
"react-dom": "^18.2.0",
|
|
134
134
|
"react-ocl": "^6.1.0",
|
|
135
135
|
"rimraf": "^5.0.5",
|
|
136
|
-
"storybook": "7.6.
|
|
136
|
+
"storybook": "7.6.16",
|
|
137
137
|
"typescript": "^5.3.3",
|
|
138
|
-
"vite": "^5.
|
|
139
|
-
"vitest": "^1.
|
|
138
|
+
"vite": "^5.1.3",
|
|
139
|
+
"vitest": "^1.3.0"
|
|
140
140
|
},
|
|
141
141
|
"repository": {
|
|
142
142
|
"type": "git",
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
1
2
|
import {
|
|
2
3
|
AnchorButton as BlueprintAnchorButton,
|
|
3
4
|
AnchorButtonProps as BlueprintAnchorButtonProps,
|
|
4
5
|
Button as BlueprintButton,
|
|
5
6
|
ButtonProps as BlueprintButtonProps,
|
|
7
|
+
Tag,
|
|
8
|
+
TagProps,
|
|
6
9
|
Tooltip,
|
|
7
10
|
TooltipProps,
|
|
8
11
|
} from '@blueprintjs/core';
|
|
12
|
+
import { css } from '@emotion/react';
|
|
13
|
+
import { ReactNode } from 'react';
|
|
9
14
|
|
|
10
15
|
type BlueprintProps = {
|
|
11
16
|
[key in keyof BlueprintButtonProps &
|
|
@@ -14,10 +19,12 @@ type BlueprintProps = {
|
|
|
14
19
|
};
|
|
15
20
|
export type ButtonProps = BlueprintProps & {
|
|
16
21
|
tooltipProps?: Omit<TooltipProps, 'children'>;
|
|
22
|
+
tag?: ReactNode;
|
|
23
|
+
tagProps?: Omit<TagProps, 'children'>;
|
|
17
24
|
};
|
|
18
25
|
|
|
19
26
|
export function Button(props: ButtonProps) {
|
|
20
|
-
const { tooltipProps, children, ...buttonProps } = props;
|
|
27
|
+
const { tooltipProps, children, tag, tagProps, ...buttonProps } = props;
|
|
21
28
|
|
|
22
29
|
const InnerButton = buttonProps.disabled
|
|
23
30
|
? BlueprintAnchorButton
|
|
@@ -27,9 +34,33 @@ export function Button(props: ButtonProps) {
|
|
|
27
34
|
fill={tooltipProps?.fill || buttonProps.fill}
|
|
28
35
|
{...tooltipProps}
|
|
29
36
|
renderTarget={({ isOpen, ...targetProps }) => (
|
|
30
|
-
<
|
|
31
|
-
{
|
|
32
|
-
|
|
37
|
+
<div style={{ position: 'relative' }}>
|
|
38
|
+
{tag && (
|
|
39
|
+
<Tag
|
|
40
|
+
css={css`
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
cursor: default;
|
|
45
|
+
font-size: 0.875em;
|
|
46
|
+
padding: 2px !important;
|
|
47
|
+
min-height: 15px;
|
|
48
|
+
min-width: 15px;
|
|
49
|
+
line-height: 1em;
|
|
50
|
+
text-align: center;
|
|
51
|
+
z-index: 20;
|
|
52
|
+
`}
|
|
53
|
+
round
|
|
54
|
+
intent="success"
|
|
55
|
+
{...tagProps}
|
|
56
|
+
>
|
|
57
|
+
{tag}
|
|
58
|
+
</Tag>
|
|
59
|
+
)}
|
|
60
|
+
<InnerButton {...targetProps} {...buttonProps} style={{}}>
|
|
61
|
+
{children}
|
|
62
|
+
</InnerButton>
|
|
63
|
+
</div>
|
|
33
64
|
)}
|
|
34
65
|
/>
|
|
35
66
|
);
|
|
@@ -6,7 +6,6 @@ import { ReactNode } from 'react';
|
|
|
6
6
|
import { InputVariant } from '../styles';
|
|
7
7
|
|
|
8
8
|
import { ButtonRadioItem } from './ButtonRadioItem';
|
|
9
|
-
import { ClassicRadioItem } from './ClassicRadioItem';
|
|
10
9
|
|
|
11
10
|
export interface RadioOption {
|
|
12
11
|
value: string;
|
|
@@ -15,7 +14,6 @@ export interface RadioOption {
|
|
|
15
14
|
}
|
|
16
15
|
export interface RadioGroupProps {
|
|
17
16
|
selected?: RadioOption;
|
|
18
|
-
type?: 'classic' | 'button';
|
|
19
17
|
options?: RadioOption[];
|
|
20
18
|
onSelect?: (option: RadioOption) => void;
|
|
21
19
|
name?: string;
|
|
@@ -44,7 +42,6 @@ export function RadioGroup(props: RadioGroupProps) {
|
|
|
44
42
|
const {
|
|
45
43
|
id,
|
|
46
44
|
selected,
|
|
47
|
-
type = 'classic',
|
|
48
45
|
disabled: groupDisabled = false,
|
|
49
46
|
options = [],
|
|
50
47
|
onSelect,
|
|
@@ -54,12 +51,9 @@ export function RadioGroup(props: RadioGroupProps) {
|
|
|
54
51
|
return (
|
|
55
52
|
<RadioGroupRadix.Root
|
|
56
53
|
id={id}
|
|
57
|
-
css={[
|
|
58
|
-
rootStyles.basic,
|
|
59
|
-
type === 'classic' ? null : rootStyles.button(variant),
|
|
60
|
-
]}
|
|
54
|
+
css={[rootStyles.basic, rootStyles.button(variant)]}
|
|
61
55
|
style={{
|
|
62
|
-
gap:
|
|
56
|
+
gap: 0,
|
|
63
57
|
}}
|
|
64
58
|
value={selected?.value}
|
|
65
59
|
name={name}
|
|
@@ -67,7 +61,6 @@ export function RadioGroup(props: RadioGroupProps) {
|
|
|
67
61
|
>
|
|
68
62
|
{options?.map(({ value, label, disabled }) => {
|
|
69
63
|
const childProps = {
|
|
70
|
-
key: value,
|
|
71
64
|
value,
|
|
72
65
|
label,
|
|
73
66
|
disabled: groupDisabled || disabled,
|
|
@@ -75,11 +68,7 @@ export function RadioGroup(props: RadioGroupProps) {
|
|
|
75
68
|
variant,
|
|
76
69
|
name,
|
|
77
70
|
};
|
|
78
|
-
return
|
|
79
|
-
<ClassicRadioItem {...childProps} />
|
|
80
|
-
) : (
|
|
81
|
-
<ButtonRadioItem {...childProps} />
|
|
82
|
-
);
|
|
71
|
+
return <ButtonRadioItem key={value} {...childProps} />;
|
|
83
72
|
})}
|
|
84
73
|
</RadioGroupRadix.Root>
|
|
85
74
|
);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { MenuItem } from '@blueprintjs/core';
|
|
2
|
+
import { ItemRenderer } from '@blueprintjs/select';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
export function useSelect<T extends { label: string }>() {
|
|
6
|
+
const [value, setValue] = useState<T | null>(null);
|
|
7
|
+
const itemRenderer = getItemRenderer(value);
|
|
8
|
+
const onItemSelect = setValue;
|
|
9
|
+
const popoverProps = {
|
|
10
|
+
onOpened: (node: HTMLElement) => {
|
|
11
|
+
const firstUl = node.querySelector('ul');
|
|
12
|
+
if (firstUl) {
|
|
13
|
+
firstUl.tabIndex = 0;
|
|
14
|
+
firstUl.focus();
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
const popoverTargetProps = {
|
|
19
|
+
style: { display: 'inline-block' },
|
|
20
|
+
};
|
|
21
|
+
const itemPredicate = (query: string, item: T) => {
|
|
22
|
+
return item.label.toLowerCase().includes(query.toLowerCase());
|
|
23
|
+
};
|
|
24
|
+
const itemListPredicate = (query: string, items: T[]) => {
|
|
25
|
+
return items.filter((item) =>
|
|
26
|
+
item.label.toLowerCase().includes(query.toLowerCase()),
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
value,
|
|
31
|
+
setValue,
|
|
32
|
+
itemRenderer,
|
|
33
|
+
onItemSelect,
|
|
34
|
+
popoverProps,
|
|
35
|
+
popoverTargetProps,
|
|
36
|
+
itemPredicate,
|
|
37
|
+
itemListPredicate,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getItemRenderer<T extends { label: string }>(value: T | null) {
|
|
42
|
+
const render: ItemRenderer<T> = (
|
|
43
|
+
{ label },
|
|
44
|
+
{ handleClick, handleFocus, modifiers, index },
|
|
45
|
+
) => (
|
|
46
|
+
<MenuItem
|
|
47
|
+
active={modifiers.active}
|
|
48
|
+
disabled={modifiers.disabled}
|
|
49
|
+
selected={value?.label === label}
|
|
50
|
+
key={index}
|
|
51
|
+
onClick={handleClick}
|
|
52
|
+
onFocus={handleFocus}
|
|
53
|
+
roleStructure="listoption"
|
|
54
|
+
text={label}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
return render;
|
|
58
|
+
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Intent,
|
|
7
7
|
Popover,
|
|
8
8
|
PopoverProps,
|
|
9
|
+
TagProps,
|
|
9
10
|
Icon,
|
|
10
11
|
} from '@blueprintjs/core';
|
|
11
12
|
import { IconName } from '@blueprintjs/icons';
|
|
@@ -28,6 +29,12 @@ import {
|
|
|
28
29
|
useToolbarContext,
|
|
29
30
|
} from './toolbarContext';
|
|
30
31
|
|
|
32
|
+
export type PopoverInteractionType =
|
|
33
|
+
| 'click'
|
|
34
|
+
| 'hover'
|
|
35
|
+
| 'click-target'
|
|
36
|
+
| 'hover-target';
|
|
37
|
+
|
|
31
38
|
interface ToolbarBaseProps {
|
|
32
39
|
intent?: Intent;
|
|
33
40
|
disabled?: boolean;
|
|
@@ -41,6 +48,7 @@ export interface ToolbarProps extends ToolbarBaseProps {
|
|
|
41
48
|
| Iterable<ReactNode>
|
|
42
49
|
| boolean
|
|
43
50
|
| null;
|
|
51
|
+
popoverInteractionKind?: PopoverInteractionType;
|
|
44
52
|
}
|
|
45
53
|
|
|
46
54
|
export interface ToolbarItemProps extends ToolbarBaseProps {
|
|
@@ -52,6 +60,8 @@ export interface ToolbarItemProps extends ToolbarBaseProps {
|
|
|
52
60
|
className?: string;
|
|
53
61
|
noTooltip?: boolean;
|
|
54
62
|
isPopover?: boolean;
|
|
63
|
+
tag?: ReactNode;
|
|
64
|
+
tagProps?: Omit<TagProps, 'children'>;
|
|
55
65
|
}
|
|
56
66
|
|
|
57
67
|
export interface ToolbarPopoverItemProps extends PopoverProps {
|
|
@@ -61,11 +71,18 @@ export interface ToolbarPopoverItemProps extends PopoverProps {
|
|
|
61
71
|
const border = '1px solid rgb(247, 247, 247)';
|
|
62
72
|
|
|
63
73
|
export function Toolbar(props: ToolbarProps) {
|
|
64
|
-
const {
|
|
74
|
+
const {
|
|
75
|
+
children,
|
|
76
|
+
disabled,
|
|
77
|
+
intent,
|
|
78
|
+
large,
|
|
79
|
+
vertical,
|
|
80
|
+
popoverInteractionKind,
|
|
81
|
+
} = props;
|
|
65
82
|
|
|
66
83
|
const contextValue = useMemo(
|
|
67
|
-
() => ({ intent, large, vertical, disabled }),
|
|
68
|
-
[intent, large, vertical, disabled],
|
|
84
|
+
() => ({ intent, large, vertical, disabled, popoverInteractionKind }),
|
|
85
|
+
[intent, large, vertical, disabled, popoverInteractionKind],
|
|
69
86
|
);
|
|
70
87
|
const ref = useRef<HTMLDivElement>(null);
|
|
71
88
|
|
|
@@ -214,13 +231,15 @@ Toolbar.PopoverItem = function ToolbarPopoverItem(
|
|
|
214
231
|
props: ToolbarPopoverItemProps,
|
|
215
232
|
) {
|
|
216
233
|
const { itemProps, ...other } = props;
|
|
217
|
-
const { disabled, vertical } = useToolbarContext();
|
|
234
|
+
const { disabled, vertical, popoverInteractionKind } = useToolbarContext();
|
|
218
235
|
|
|
219
236
|
return (
|
|
220
237
|
<Popover
|
|
221
238
|
minimal
|
|
222
239
|
disabled={disabled}
|
|
223
240
|
placement={vertical ? 'right-start' : 'bottom-start'}
|
|
241
|
+
interactionKind={popoverInteractionKind}
|
|
242
|
+
hoverCloseDelay={0}
|
|
224
243
|
css={css`
|
|
225
244
|
.${Classes.ICON} {
|
|
226
245
|
color: ${Colors.DARK_GRAY3};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Intent } from '@blueprintjs/core';
|
|
2
2
|
import { createContext, useContext } from 'react';
|
|
3
3
|
|
|
4
|
+
import { PopoverInteractionType } from './Toolbar';
|
|
5
|
+
|
|
4
6
|
export interface ToolbarContext {
|
|
5
7
|
intent?: Intent;
|
|
6
8
|
large?: boolean;
|
|
7
9
|
vertical?: boolean;
|
|
8
10
|
disabled?: boolean;
|
|
11
|
+
popoverInteractionKind?: PopoverInteractionType;
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
export const toolbarContext = createContext<ToolbarContext | null>(null);
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { RadioOption, RadioGroupProps } from './RadioGroup';
|
|
2
|
-
export declare function ClassicRadioItem(props: RadioOption & Pick<RadioGroupProps, 'onSelect' | 'variant' | 'name'>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
|
-
//# sourceMappingURL=ClassicRadioItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClassicRadioItem.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/radio-group/ClassicRadioItem.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA0D5D,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC,oDA4B5E"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ClassicRadioItem = void 0;
|
|
27
|
-
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
28
|
-
/** @jsxImportSource @emotion/react */
|
|
29
|
-
const react_1 = require("@emotion/react");
|
|
30
|
-
const RadioGroup = __importStar(require("@radix-ui/react-radio-group"));
|
|
31
|
-
const styles_1 = require("../styles");
|
|
32
|
-
const classicStyles = {
|
|
33
|
-
container: (disabled) => (0, react_1.css)({
|
|
34
|
-
display: 'flex',
|
|
35
|
-
alignItems: 'center',
|
|
36
|
-
flexDirection: 'row-reverse',
|
|
37
|
-
opacity: disabled ? 0.25 : 1,
|
|
38
|
-
overflow: 'hidden',
|
|
39
|
-
border: 'none',
|
|
40
|
-
}),
|
|
41
|
-
item: (disabled, variant) => (0, react_1.css)({
|
|
42
|
-
position: 'relative',
|
|
43
|
-
width: variant === 'default' ? 16 : 14,
|
|
44
|
-
height: variant === 'default' ? 16 : 14,
|
|
45
|
-
borderRadius: '50%',
|
|
46
|
-
border: '1px solid grey',
|
|
47
|
-
backgroundColor: disabled ? styles_1.disabledColor : 'white',
|
|
48
|
-
':hover': {
|
|
49
|
-
borderColor: disabled ? 'grey' : styles_1.enabledColor,
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
52
|
-
indicator: (0, react_1.css)({
|
|
53
|
-
position: 'absolute',
|
|
54
|
-
top: -1,
|
|
55
|
-
left: -1,
|
|
56
|
-
right: -1,
|
|
57
|
-
bottom: -1,
|
|
58
|
-
zIndex: 10,
|
|
59
|
-
display: 'flex',
|
|
60
|
-
alignItems: 'center',
|
|
61
|
-
justifyContent: 'center',
|
|
62
|
-
backgroundColor: styles_1.enabledColor,
|
|
63
|
-
borderRadius: '50%',
|
|
64
|
-
}),
|
|
65
|
-
circle: (0, react_1.css)({
|
|
66
|
-
width: '40%',
|
|
67
|
-
height: '40%',
|
|
68
|
-
borderRadius: '50%',
|
|
69
|
-
backgroundColor: 'white',
|
|
70
|
-
}),
|
|
71
|
-
label: (disabled) => (0, react_1.css)({
|
|
72
|
-
cursor: 'pointer',
|
|
73
|
-
lineHeight: 1,
|
|
74
|
-
paddingLeft: 5,
|
|
75
|
-
':hover': {
|
|
76
|
-
'& ~ button': {
|
|
77
|
-
borderColor: disabled ? 'grey' : styles_1.enabledColor,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
}),
|
|
81
|
-
};
|
|
82
|
-
function ClassicRadioItem(props) {
|
|
83
|
-
const { value, label, disabled = false, onSelect, variant, name } = props;
|
|
84
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: classicStyles.container(disabled), children: [(0, jsx_runtime_1.jsx)("label", { css: classicStyles.label(disabled), style: {
|
|
85
|
-
fontSize: variant === 'small' ? '1em' : '1.125em',
|
|
86
|
-
}, htmlFor: `${value}${name}`, children: label }), (0, jsx_runtime_1.jsx)(RadioGroup.Item, { css: classicStyles.item(disabled, variant), value: value, id: `${value}${name}`, onClick: () => {
|
|
87
|
-
if (!disabled)
|
|
88
|
-
onSelect?.(props);
|
|
89
|
-
}, children: (0, jsx_runtime_1.jsx)(RadioGroup.Indicator, { css: classicStyles.indicator, children: (0, jsx_runtime_1.jsx)("div", { css: classicStyles.circle }) }) })] }));
|
|
90
|
-
}
|
|
91
|
-
exports.ClassicRadioItem = ClassicRadioItem;
|
|
92
|
-
//# sourceMappingURL=ClassicRadioItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClassicRadioItem.js","sourceRoot":"","sources":["../../../../src/components/forms/radio-group/ClassicRadioItem.tsx"],"names":[],"mappings":";;;;;;;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AC,SAAS,YAChD,gCAAK,GAAG,EAAE,aAAa,CAAC,MAAM,GAAI,GACb,GACP,IACd,CACP,CAAC;AACJ,CAAC;AA7BD,4CA6BC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { RadioOption, RadioGroupProps } from './RadioGroup';
|
|
2
|
-
export declare function ClassicRadioItem(props: RadioOption & Pick<RadioGroupProps, 'onSelect' | 'variant' | 'name'>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
|
-
//# sourceMappingURL=ClassicRadioItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClassicRadioItem.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/radio-group/ClassicRadioItem.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA0D5D,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC,oDA4B5E"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
import * as RadioGroup from '@radix-ui/react-radio-group';
|
|
5
|
-
import { disabledColor, enabledColor } from '../styles';
|
|
6
|
-
const classicStyles = {
|
|
7
|
-
container: (disabled) => css({
|
|
8
|
-
display: 'flex',
|
|
9
|
-
alignItems: 'center',
|
|
10
|
-
flexDirection: 'row-reverse',
|
|
11
|
-
opacity: disabled ? 0.25 : 1,
|
|
12
|
-
overflow: 'hidden',
|
|
13
|
-
border: 'none',
|
|
14
|
-
}),
|
|
15
|
-
item: (disabled, variant) => css({
|
|
16
|
-
position: 'relative',
|
|
17
|
-
width: variant === 'default' ? 16 : 14,
|
|
18
|
-
height: variant === 'default' ? 16 : 14,
|
|
19
|
-
borderRadius: '50%',
|
|
20
|
-
border: '1px solid grey',
|
|
21
|
-
backgroundColor: disabled ? disabledColor : 'white',
|
|
22
|
-
':hover': {
|
|
23
|
-
borderColor: disabled ? 'grey' : enabledColor,
|
|
24
|
-
},
|
|
25
|
-
}),
|
|
26
|
-
indicator: css({
|
|
27
|
-
position: 'absolute',
|
|
28
|
-
top: -1,
|
|
29
|
-
left: -1,
|
|
30
|
-
right: -1,
|
|
31
|
-
bottom: -1,
|
|
32
|
-
zIndex: 10,
|
|
33
|
-
display: 'flex',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
justifyContent: 'center',
|
|
36
|
-
backgroundColor: enabledColor,
|
|
37
|
-
borderRadius: '50%',
|
|
38
|
-
}),
|
|
39
|
-
circle: css({
|
|
40
|
-
width: '40%',
|
|
41
|
-
height: '40%',
|
|
42
|
-
borderRadius: '50%',
|
|
43
|
-
backgroundColor: 'white',
|
|
44
|
-
}),
|
|
45
|
-
label: (disabled) => css({
|
|
46
|
-
cursor: 'pointer',
|
|
47
|
-
lineHeight: 1,
|
|
48
|
-
paddingLeft: 5,
|
|
49
|
-
':hover': {
|
|
50
|
-
'& ~ button': {
|
|
51
|
-
borderColor: disabled ? 'grey' : enabledColor,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
}),
|
|
55
|
-
};
|
|
56
|
-
export function ClassicRadioItem(props) {
|
|
57
|
-
const { value, label, disabled = false, onSelect, variant, name } = props;
|
|
58
|
-
return (_jsxs("div", { css: classicStyles.container(disabled), children: [_jsx("label", { css: classicStyles.label(disabled), style: {
|
|
59
|
-
fontSize: variant === 'small' ? '1em' : '1.125em',
|
|
60
|
-
}, htmlFor: `${value}${name}`, children: label }), _jsx(RadioGroup.Item, { css: classicStyles.item(disabled, variant), value: value, id: `${value}${name}`, onClick: () => {
|
|
61
|
-
if (!disabled)
|
|
62
|
-
onSelect?.(props);
|
|
63
|
-
}, children: _jsx(RadioGroup.Indicator, { css: classicStyles.indicator, children: _jsx("div", { css: classicStyles.circle }) }) })] }));
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=ClassicRadioItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClassicRadioItem.js","sourceRoot":"","sources":["../../../../src/components/forms/radio-group/ClassicRadioItem.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAgB,MAAM,WAAW,CAAC;AAItE,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,CAAC,QAAiB,EAAE,EAAE,CAC/B,GAAG,CAAC;QACF,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,aAAa;QAC5B,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5B,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,MAAM;KACf,CAAC;IACJ,IAAI,EAAE,CAAC,QAAiB,EAAE,OAAsB,EAAE,EAAE,CAClD,GAAG,CAAC;QACF,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACtC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACvC,YAAY,EAAE,KAAK;QACnB,MAAM,EAAE,gBAAgB;QACxB,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO;QACnD,QAAQ,EAAE;YACR,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY;SAC9C;KACF,CAAC;IAEJ,SAAS,EAAE,GAAG,CAAC;QACb,QAAQ,E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