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
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { AnchorButtonProps as BlueprintAnchorButtonProps, ButtonProps as BlueprintButtonProps, TagProps, TooltipProps } from '@blueprintjs/core';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
type BlueprintProps = {
|
|
3
5
|
[key in keyof BlueprintButtonProps & keyof BlueprintAnchorButtonProps]?: BlueprintButtonProps[key] & BlueprintAnchorButtonProps[key];
|
|
4
6
|
};
|
|
5
7
|
export type ButtonProps = BlueprintProps & {
|
|
6
8
|
tooltipProps?: Omit<TooltipProps, 'children'>;
|
|
9
|
+
tag?: ReactNode;
|
|
10
|
+
tagProps?: Omit<TagProps, 'children'>;
|
|
7
11
|
};
|
|
8
|
-
export declare function Button(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function Button(props: ButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
13
|
export {};
|
|
10
14
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,IAAI,0BAA0B,EAE/C,WAAW,IAAI,oBAAoB,EAEnC,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;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAEL,iBAAiB,IAAI,0BAA0B,EAE/C,WAAW,IAAI,oBAAoB,EAEnC,QAAQ,EAER,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,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;IAC9C,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;CACvC,CAAC;AAEF,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,oDAyCxC"}
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Button = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
+
/** @jsxImportSource @emotion/react */
|
|
5
6
|
const core_1 = require("@blueprintjs/core");
|
|
7
|
+
const react_1 = require("@emotion/react");
|
|
6
8
|
function Button(props) {
|
|
7
|
-
const { tooltipProps, children, ...buttonProps } = props;
|
|
9
|
+
const { tooltipProps, children, tag, tagProps, ...buttonProps } = props;
|
|
8
10
|
const InnerButton = buttonProps.disabled
|
|
9
11
|
? core_1.AnchorButton
|
|
10
12
|
: core_1.Button;
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(core_1.Tooltip, { fill: tooltipProps?.fill || buttonProps.fill, ...tooltipProps, renderTarget: ({ isOpen, ...targetProps }) => ((0, jsx_runtime_1.
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(core_1.Tooltip, { fill: tooltipProps?.fill || buttonProps.fill, ...tooltipProps, renderTarget: ({ isOpen, ...targetProps }) => ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative' }, children: [tag && ((0, jsx_runtime_1.jsx)(core_1.Tag, { css: (0, react_1.css) `
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
cursor: default;
|
|
18
|
+
font-size: 0.875em;
|
|
19
|
+
padding: 2px !important;
|
|
20
|
+
min-height: 15px;
|
|
21
|
+
min-width: 15px;
|
|
22
|
+
line-height: 1em;
|
|
23
|
+
text-align: center;
|
|
24
|
+
z-index: 20;
|
|
25
|
+
`, round: true, intent: "success", ...tagProps, children: tag })), (0, jsx_runtime_1.jsx)(InnerButton, { ...targetProps, ...buttonProps, style: {}, children: children })] })) }));
|
|
12
26
|
}
|
|
13
27
|
exports.Button = Button;
|
|
14
28
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":";;;;AAAA,sCAAsC;AACtC,4CAS2B;AAC3B,0CAAqC;AAcrC,SAAgB,MAAM,CAAC,KAAkB;IACvC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IAExE,MAAM,WAAW,GAAG,WAAW,CAAC,QAAQ;QACtC,CAAC,CAAC,mBAAqB;QACvB,CAAC,CAAC,aAAe,CAAC;IACpB,OAAO,CACL,uBAAC,cAAO,IACN,IAAI,EAAE,YAAY,EAAE,IAAI,IAAI,WAAW,CAAC,IAAI,KACxC,YAAY,EAChB,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,EAAE,EAAE,CAAC,CAC5C,iCAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,aACjC,GAAG,IAAI,CACN,uBAAC,UAAG,IACF,GAAG,EAAE,IAAA,WAAG,EAAA;;;;;;;;;;;;eAYP,EACD,KAAK,QACL,MAAM,EAAC,SAAS,KACZ,QAAQ,YAEX,GAAG,GACA,CACP,EACD,uBAAC,WAAW,OAAK,WAAW,KAAM,WAAW,EAAE,KAAK,EAAE,EAAE,YACrD,QAAQ,GACG,IACV,CACP,GACD,CACH,CAAC;AACJ,CAAC;AAzCD,wBAyCC"}
|
|
@@ -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;
|
|
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;AAIzC,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,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,oDAkChD"}
|
|
@@ -29,7 +29,6 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
29
29
|
const react_1 = require("@emotion/react");
|
|
30
30
|
const RadioGroupRadix = __importStar(require("@radix-ui/react-radio-group"));
|
|
31
31
|
const ButtonRadioItem_1 = require("./ButtonRadioItem");
|
|
32
|
-
const ClassicRadioItem_1 = require("./ClassicRadioItem");
|
|
33
32
|
const rootStyles = {
|
|
34
33
|
basic: (0, react_1.css)({
|
|
35
34
|
display: 'flex',
|
|
@@ -47,15 +46,11 @@ const rootStyles = {
|
|
|
47
46
|
}),
|
|
48
47
|
};
|
|
49
48
|
function RadioGroup(props) {
|
|
50
|
-
const { id, selected,
|
|
51
|
-
return ((0, jsx_runtime_1.jsx)(RadioGroupRadix.Root, { id: id, css: [
|
|
52
|
-
|
|
53
|
-
type === 'classic' ? null : rootStyles.button(variant),
|
|
54
|
-
], style: {
|
|
55
|
-
gap: type === 'classic' ? (variant === 'default' ? 10 : 5) : 0,
|
|
49
|
+
const { id, selected, disabled: groupDisabled = false, options = [], onSelect, name = '', variant = 'default', } = props;
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(RadioGroupRadix.Root, { id: id, css: [rootStyles.basic, rootStyles.button(variant)], style: {
|
|
51
|
+
gap: 0,
|
|
56
52
|
}, value: selected?.value, name: name, disabled: groupDisabled, children: options?.map(({ value, label, disabled }) => {
|
|
57
53
|
const childProps = {
|
|
58
|
-
key: value,
|
|
59
54
|
value,
|
|
60
55
|
label,
|
|
61
56
|
disabled: groupDisabled || disabled,
|
|
@@ -63,7 +58,7 @@ function RadioGroup(props) {
|
|
|
63
58
|
variant,
|
|
64
59
|
name,
|
|
65
60
|
};
|
|
66
|
-
return
|
|
61
|
+
return (0, jsx_runtime_1.jsx)(ButtonRadioItem_1.ButtonRadioItem, { ...childProps }, value);
|
|
67
62
|
}) }));
|
|
68
63
|
}
|
|
69
64
|
exports.RadioGroup = RadioGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../../src/components/forms/radio-group/RadioGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,0CAAqC;AACrC,6EAA+D;AAK/D,uDAAoD;
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../../src/components/forms/radio-group/RadioGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,0CAAqC;AACrC,6EAA+D;AAK/D,uDAAoD;AAgBpD,MAAM,UAAU,GAAG;IACjB,KAAK,EAAE,IAAA,WAAG,EAAC;QACT,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,aAAa;KACrB,CAAC;IACF,MAAM,EAAE,CAAC,OAAqB,EAAE,EAAE,CAChC,IAAA,WAAG,EAAC;QACF,gDAAgD,EAAE;YAChD,YAAY,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa;SACpE;QACD,8CAA8C,EAAE;YAC9C,gBAAgB,EAAE,CAAC;YACnB,YAAY,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa;SACpE;KACF,CAAC;CACL,CAAC;AACF,SAAgB,UAAU,CAAC,KAAsB;IAC/C,MAAM,EACJ,EAAE,EACF,QAAQ,EACR,QAAQ,EAAE,aAAa,GAAG,KAAK,EAC/B,OAAO,GAAG,EAAE,EACZ,QAAQ,EACR,IAAI,GAAG,EAAE,EACT,OAAO,GAAG,SAAS,GACpB,GAAG,KAAK,CAAC;IACV,OAAO,CACL,uBAAC,eAAe,CAAC,IAAI,IACnB,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EACnD,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;SACP,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,KAAK;gBACL,KAAK;gBACL,QAAQ,EAAE,aAAa,IAAI,QAAQ;gBACnC,QAAQ;gBACR,OAAO;gBACP,IAAI;aACL,CAAC;YACF,OAAO,uBAAC,iCAAe,OAAiB,UAAU,IAArB,KAAK,CAAoB,CAAC;QACzD,CAAC,CAAC,GACmB,CACxB,CAAC;AACJ,CAAC;AAlCD,gCAkCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -20,4 +20,5 @@ __exportStar(require("./useModifiedPopper"), exports);
|
|
|
20
20
|
__exportStar(require("./useOnClickOutside"), exports);
|
|
21
21
|
__exportStar(require("./useOnOff"), exports);
|
|
22
22
|
__exportStar(require("./useToggle"), exports);
|
|
23
|
+
__exportStar(require("./useSelect"), exports);
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,wDAAsC;AACtC,sDAAoC;AACpC,sDAAoC;AACpC,6CAA2B;AAC3B,8CAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,wDAAsC;AACtC,sDAAoC;AACpC,sDAAoC;AACpC,6CAA2B;AAC3B,8CAA4B;AAC5B,8CAA4B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ItemRenderer } from '@blueprintjs/select';
|
|
3
|
+
export declare function useSelect<T extends {
|
|
4
|
+
label: string;
|
|
5
|
+
}>(): {
|
|
6
|
+
value: T | null;
|
|
7
|
+
setValue: import("react").Dispatch<import("react").SetStateAction<T | null>>;
|
|
8
|
+
itemRenderer: ItemRenderer<T>;
|
|
9
|
+
onItemSelect: import("react").Dispatch<import("react").SetStateAction<T | null>>;
|
|
10
|
+
popoverProps: {
|
|
11
|
+
onOpened: (node: HTMLElement) => void;
|
|
12
|
+
};
|
|
13
|
+
popoverTargetProps: {
|
|
14
|
+
style: {
|
|
15
|
+
display: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
itemPredicate: (query: string, item: T) => boolean;
|
|
19
|
+
itemListPredicate: (query: string, items: T[]) => T[];
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=useSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSelect.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useSelect.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,wBAAgB,SAAS,CAAC,CAAC,SAAS;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE;;;;;;yBAKhC,WAAW;;;;;;;2BAWA,MAAM,QAAQ,CAAC;+BAGX,MAAM,SAAS,CAAC,EAAE;EAerD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSelect = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const core_1 = require("@blueprintjs/core");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
function useSelect() {
|
|
8
|
+
const [value, setValue] = (0, react_1.useState)(null);
|
|
9
|
+
const itemRenderer = getItemRenderer(value);
|
|
10
|
+
const onItemSelect = setValue;
|
|
11
|
+
const popoverProps = {
|
|
12
|
+
onOpened: (node) => {
|
|
13
|
+
const firstUl = node.querySelector('ul');
|
|
14
|
+
if (firstUl) {
|
|
15
|
+
firstUl.tabIndex = 0;
|
|
16
|
+
firstUl.focus();
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
const popoverTargetProps = {
|
|
21
|
+
style: { display: 'inline-block' },
|
|
22
|
+
};
|
|
23
|
+
const itemPredicate = (query, item) => {
|
|
24
|
+
return item.label.toLowerCase().includes(query.toLowerCase());
|
|
25
|
+
};
|
|
26
|
+
const itemListPredicate = (query, items) => {
|
|
27
|
+
return items.filter((item) => item.label.toLowerCase().includes(query.toLowerCase()));
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
value,
|
|
31
|
+
setValue,
|
|
32
|
+
itemRenderer,
|
|
33
|
+
onItemSelect,
|
|
34
|
+
popoverProps,
|
|
35
|
+
popoverTargetProps,
|
|
36
|
+
itemPredicate,
|
|
37
|
+
itemListPredicate,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.useSelect = useSelect;
|
|
41
|
+
function getItemRenderer(value) {
|
|
42
|
+
const render = ({ label }, { handleClick, handleFocus, modifiers, index }) => ((0, jsx_runtime_1.jsx)(core_1.MenuItem, { active: modifiers.active, disabled: modifiers.disabled, selected: value?.label === label, onClick: handleClick, onFocus: handleFocus, roleStructure: "listoption", text: label }, index));
|
|
43
|
+
return render;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=useSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSelect.js","sourceRoot":"","sources":["../../../src/components/hooks/useSelect.tsx"],"names":[],"mappings":";;;;AAAA,4CAA6C;AAE7C,iCAAiC;AAEjC,SAAgB,SAAS;IACvB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAW,IAAI,CAAC,CAAC;IACnD,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,QAAQ,CAAC;IAC9B,MAAM,YAAY,GAAG;QACnB,QAAQ,EAAE,CAAC,IAAiB,EAAE,EAAE;YAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YACzC,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;gBACrB,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,CAAC;QACH,CAAC;KACF,CAAC;IACF,MAAM,kBAAkB,GAAG;QACzB,KAAK,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;KACnC,CAAC;IACF,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,IAAO,EAAE,EAAE;QAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAChE,CAAC,CAAC;IACF,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,KAAU,EAAE,EAAE;QACtD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAC3B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CACvD,CAAC;IACJ,CAAC,CAAC;IACF,OAAO;QACL,KAAK;QACL,QAAQ;QACR,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,kBAAkB;QAClB,aAAa;QACb,iBAAiB;KAClB,CAAC;AACJ,CAAC;AAlCD,8BAkCC;AAED,SAAS,eAAe,CAA8B,KAAe;IACnE,MAAM,MAAM,GAAoB,CAC9B,EAAE,KAAK,EAAE,EACT,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,EAC9C,EAAE,CAAC,CACH,uBAAC,eAAQ,IACP,MAAM,EAAE,SAAS,CAAC,MAAM,EACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAC5B,QAAQ,EAAE,KAAK,EAAE,KAAK,KAAK,KAAK,EAEhC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,aAAa,EAAC,YAAY,EAC1B,IAAI,EAAE,KAAK,IAJN,KAAK,CAKV,CACH,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { Intent, PopoverProps } from '@blueprintjs/core';
|
|
2
|
+
import { Intent, PopoverProps, TagProps } from '@blueprintjs/core';
|
|
3
3
|
import { IconName } from '@blueprintjs/icons';
|
|
4
4
|
import { JSX, ReactElement, ReactNode } from 'react';
|
|
5
|
+
export type PopoverInteractionType = 'click' | 'hover' | 'click-target' | 'hover-target';
|
|
5
6
|
interface ToolbarBaseProps {
|
|
6
7
|
intent?: Intent;
|
|
7
8
|
disabled?: boolean;
|
|
@@ -10,6 +11,7 @@ export interface ToolbarProps extends ToolbarBaseProps {
|
|
|
10
11
|
vertical?: boolean;
|
|
11
12
|
large?: boolean;
|
|
12
13
|
children?: Array<ReactElement<ToolbarItemProps>> | ReactElement<ToolbarItemProps> | Iterable<ReactNode> | boolean | null;
|
|
14
|
+
popoverInteractionKind?: PopoverInteractionType;
|
|
13
15
|
}
|
|
14
16
|
export interface ToolbarItemProps extends ToolbarBaseProps {
|
|
15
17
|
id?: string;
|
|
@@ -20,6 +22,8 @@ export interface ToolbarItemProps extends ToolbarBaseProps {
|
|
|
20
22
|
className?: string;
|
|
21
23
|
noTooltip?: boolean;
|
|
22
24
|
isPopover?: boolean;
|
|
25
|
+
tag?: ReactNode;
|
|
26
|
+
tagProps?: Omit<TagProps, 'children'>;
|
|
23
27
|
}
|
|
24
28
|
export interface ToolbarPopoverItemProps extends PopoverProps {
|
|
25
29
|
itemProps: ToolbarItemProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAIL,MAAM,EAEN,YAAY,
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAIL,MAAM,EAEN,YAAY,EACZ,QAAQ,EAET,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAEL,GAAG,EACH,YAAY,EACZ,SAAS,EAIV,MAAM,OAAO,CAAC;AAUf,MAAM,MAAM,sBAAsB,GAC9B,OAAO,GACP,OAAO,GACP,cAAc,GACd,cAAc,CAAC;AAEnB,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AACD,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EACL,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,GACrC,YAAY,CAAC,gBAAgB,CAAC,GAC9B,QAAQ,CAAC,SAAS,CAAC,GACnB,OAAO,GACP,IAAI,CAAC;IACT,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACjD;AAED,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAID,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,oDA+D1C;yBA/De,OAAO"}
|
|
@@ -10,8 +10,8 @@ const index_1 = require("../index");
|
|
|
10
10
|
const toolbarContext_1 = require("./toolbarContext");
|
|
11
11
|
const border = '1px solid rgb(247, 247, 247)';
|
|
12
12
|
function Toolbar(props) {
|
|
13
|
-
const { children, disabled, intent, large, vertical } = props;
|
|
14
|
-
const contextValue = (0, react_2.useMemo)(() => ({ intent, large, vertical, disabled }), [intent, large, vertical, disabled]);
|
|
13
|
+
const { children, disabled, intent, large, vertical, popoverInteractionKind, } = props;
|
|
14
|
+
const contextValue = (0, react_2.useMemo)(() => ({ intent, large, vertical, disabled, popoverInteractionKind }), [intent, large, vertical, disabled, popoverInteractionKind]);
|
|
15
15
|
const ref = (0, react_2.useRef)(null);
|
|
16
16
|
// Work around wrong width on vertical flex when wrapping
|
|
17
17
|
// In Chrome: recently fixed (https://bugs.chromium.org/p/chromium/issues/detail?id=507397)
|
|
@@ -95,8 +95,8 @@ Toolbar.Item = function ToolbarItem(props) {
|
|
|
95
95
|
};
|
|
96
96
|
Toolbar.PopoverItem = function ToolbarPopoverItem(props) {
|
|
97
97
|
const { itemProps, ...other } = props;
|
|
98
|
-
const { disabled, vertical } = (0, toolbarContext_1.useToolbarContext)();
|
|
99
|
-
return ((0, jsx_runtime_1.jsx)(core_1.Popover, { minimal: true, disabled: disabled, placement: vertical ? 'right-start' : 'bottom-start', css: (0, react_1.css) `
|
|
98
|
+
const { disabled, vertical, popoverInteractionKind } = (0, toolbarContext_1.useToolbarContext)();
|
|
99
|
+
return ((0, jsx_runtime_1.jsx)(core_1.Popover, { minimal: true, disabled: disabled, placement: vertical ? 'right-start' : 'bottom-start', interactionKind: popoverInteractionKind, hoverCloseDelay: 0, css: (0, react_1.css) `
|
|
100
100
|
.${core_1.Classes.ICON} {
|
|
101
101
|
color: ${core_1.Colors.DARK_GRAY3};
|
|
102
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":";;;;AAAA,sCAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":";;;;AAAA,sCAAsC;AACtC,4CAS2B;AAE3B,0CAAqC;AACrC,iCAQe;AAEf,oCAAkC;AAElC,qDAI0B;AAyC1B,MAAM,MAAM,GAAG,8BAA8B,CAAC;AAE9C,SAAgB,OAAO,CAAC,KAAmB;IACzC,MAAM,EACJ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,sBAAsB,GACvB,GAAG,KAAK,CAAC;IAEV,MAAM,YAAY,GAAG,IAAA,eAAO,EAC1B,GAAG,EAAE,CAAC,CAAC,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BAAkB,CAC/C,KAA8B;IAE9B,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IACtC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,sBAAsB,EAAE,GAAG,IAAA,kCAAiB,GAAE,CAAC;IAE3E,OAAO,CACL,uBAAC,cAAO,IACN,OAAO,QACP,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,EACpD,eAAe,EAAE,sBAAsB,EACvC,eAAe,EAAE,CAAC,EAClB,GAAG,EAAE,IAAA,WAAG,EAAA;WACH,cAAO,CAAC,IAAI;mBACJ,aAAM,CAAC,UAAU;;OAE7B,EACD,WAAW,EAAE;YACX,KAAK,EAAE;gBACL,QAAQ,EAAE,UAAU;gBACpB,QAAQ,EAAE,SAAS;gBACnB,KAAK,EAAE,aAAa;gBACpB,MAAM,EAAE,aAAa;gBACrB,IAAI,EAAE,MAAM;aACb;SACF,KACG,KAAK,YAET,uBAAC,OAAO,CAAC,IAAI,IAAC,SAAS,QAAC,SAAS,WAAK,SAAS,GAAI,GAC3C,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,eAAe,CAAC,KAGxB;IACC,OAAO,CACL,uBAAC,+BAAc,CAAC,QAAQ,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,iCAAkD;
|
|
1
|
+
{"version":3,"file":"toolbarContext.js","sourceRoot":"","sources":["../../../src/components/toolbar/toolbarContext.ts"],"names":[],"mappings":";;;AACA,iCAAkD;AAYrC,QAAA,cAAc,GAAG,IAAA,qBAAa,EAAwB,IAAI,CAAC,CAAC;AAEzE,SAAgB,iBAAiB;IAC/B,MAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,sBAAc,CAAC,CAAC;IACvC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AARD,8CAQC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { AnchorButtonProps as BlueprintAnchorButtonProps, ButtonProps as BlueprintButtonProps, TagProps, TooltipProps } from '@blueprintjs/core';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
type BlueprintProps = {
|
|
3
5
|
[key in keyof BlueprintButtonProps & keyof BlueprintAnchorButtonProps]?: BlueprintButtonProps[key] & BlueprintAnchorButtonProps[key];
|
|
4
6
|
};
|
|
5
7
|
export type ButtonProps = BlueprintProps & {
|
|
6
8
|
tooltipProps?: Omit<TooltipProps, 'children'>;
|
|
9
|
+
tag?: ReactNode;
|
|
10
|
+
tagProps?: Omit<TagProps, 'children'>;
|
|
7
11
|
};
|
|
8
|
-
export declare function Button(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function Button(props: ButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
13
|
export {};
|
|
10
14
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,IAAI,0BAA0B,EAE/C,WAAW,IAAI,oBAAoB,EAEnC,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;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAEL,iBAAiB,IAAI,0BAA0B,EAE/C,WAAW,IAAI,oBAAoB,EAEnC,QAAQ,EAER,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,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;IAC9C,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;CACvC,CAAC;AAEF,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,oDAyCxC"}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { AnchorButton as BlueprintAnchorButton, Button as BlueprintButton, Tag, Tooltip, } from '@blueprintjs/core';
|
|
4
|
+
import { css } from '@emotion/react';
|
|
3
5
|
export function Button(props) {
|
|
4
|
-
const { tooltipProps, children, ...buttonProps } = props;
|
|
6
|
+
const { tooltipProps, children, tag, tagProps, ...buttonProps } = props;
|
|
5
7
|
const InnerButton = buttonProps.disabled
|
|
6
8
|
? BlueprintAnchorButton
|
|
7
9
|
: BlueprintButton;
|
|
8
|
-
return (_jsx(Tooltip, { fill: tooltipProps?.fill || buttonProps.fill, ...tooltipProps, renderTarget: ({ isOpen, ...targetProps }) => (
|
|
10
|
+
return (_jsx(Tooltip, { fill: tooltipProps?.fill || buttonProps.fill, ...tooltipProps, renderTarget: ({ isOpen, ...targetProps }) => (_jsxs("div", { style: { position: 'relative' }, children: [tag && (_jsx(Tag, { css: css `
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
cursor: default;
|
|
15
|
+
font-size: 0.875em;
|
|
16
|
+
padding: 2px !important;
|
|
17
|
+
min-height: 15px;
|
|
18
|
+
min-width: 15px;
|
|
19
|
+
line-height: 1em;
|
|
20
|
+
text-align: center;
|
|
21
|
+
z-index: 20;
|
|
22
|
+
`, round: true, intent: "success", ...tagProps, children: tag })), _jsx(InnerButton, { ...targetProps, ...buttonProps, style: {}, children: children })] })) }));
|
|
9
23
|
}
|
|
10
24
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,IAAI,qBAAqB,EAErC,MAAM,IAAI,eAAe,EAEzB,OAAO,GAER,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EACL,YAAY,IAAI,qBAAqB,EAErC,MAAM,IAAI,eAAe,EAEzB,GAAG,EAEH,OAAO,GAER,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAcrC,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;IAExE,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,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,EAAE,EAAE,CAAC,CAC5C,eAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,aACjC,GAAG,IAAI,CACN,KAAC,GAAG,IACF,GAAG,EAAE,GAAG,CAAA;;;;;;;;;;;;eAYP,EACD,KAAK,QACL,MAAM,EAAC,SAAS,KACZ,QAAQ,YAEX,GAAG,GACA,CACP,EACD,KAAC,WAAW,OAAK,WAAW,KAAM,WAAW,EAAE,KAAK,EAAE,EAAE,YACrD,QAAQ,GACG,IACV,CACP,GACD,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -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;
|
|
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;AAIzC,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,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,oDAkChD"}
|
|
@@ -3,7 +3,6 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import * as RadioGroupRadix from '@radix-ui/react-radio-group';
|
|
5
5
|
import { ButtonRadioItem } from './ButtonRadioItem';
|
|
6
|
-
import { ClassicRadioItem } from './ClassicRadioItem';
|
|
7
6
|
const rootStyles = {
|
|
8
7
|
basic: css({
|
|
9
8
|
display: 'flex',
|
|
@@ -21,15 +20,11 @@ const rootStyles = {
|
|
|
21
20
|
}),
|
|
22
21
|
};
|
|
23
22
|
export function RadioGroup(props) {
|
|
24
|
-
const { id, selected,
|
|
25
|
-
return (_jsx(RadioGroupRadix.Root, { id: id, css: [
|
|
26
|
-
|
|
27
|
-
type === 'classic' ? null : rootStyles.button(variant),
|
|
28
|
-
], style: {
|
|
29
|
-
gap: type === 'classic' ? (variant === 'default' ? 10 : 5) : 0,
|
|
23
|
+
const { id, selected, disabled: groupDisabled = false, options = [], onSelect, name = '', variant = 'default', } = props;
|
|
24
|
+
return (_jsx(RadioGroupRadix.Root, { id: id, css: [rootStyles.basic, rootStyles.button(variant)], style: {
|
|
25
|
+
gap: 0,
|
|
30
26
|
}, value: selected?.value, name: name, disabled: groupDisabled, children: options?.map(({ value, label, disabled }) => {
|
|
31
27
|
const childProps = {
|
|
32
|
-
key: value,
|
|
33
28
|
value,
|
|
34
29
|
label,
|
|
35
30
|
disabled: groupDisabled || disabled,
|
|
@@ -37,7 +32,7 @@ export function RadioGroup(props) {
|
|
|
37
32
|
variant,
|
|
38
33
|
name,
|
|
39
34
|
};
|
|
40
|
-
return
|
|
35
|
+
return _jsx(ButtonRadioItem, { ...childProps }, value);
|
|
41
36
|
}) }));
|
|
42
37
|
}
|
|
43
38
|
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -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;
|
|
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;AAgBpD,MAAM,UAAU,GAAG;IACjB,KAAK,EAAE,GAAG,CAAC;QACT,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,aAAa;KACrB,CAAC;IACF,MAAM,EAAE,CAAC,OAAqB,EAAE,EAAE,CAChC,GAAG,CAAC;QACF,gDAAgD,EAAE;YAChD,YAAY,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa;SACpE;QACD,8CAA8C,EAAE;YAC9C,gBAAgB,EAAE,CAAC;YACnB,YAAY,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa;SACpE;KACF,CAAC;CACL,CAAC;AACF,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EACJ,EAAE,EACF,QAAQ,EACR,QAAQ,EAAE,aAAa,GAAG,KAAK,EAC/B,OAAO,GAAG,EAAE,EACZ,QAAQ,EACR,IAAI,GAAG,EAAE,EACT,OAAO,GAAG,SAAS,GACpB,GAAG,KAAK,CAAC;IACV,OAAO,CACL,KAAC,eAAe,CAAC,IAAI,IACnB,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EACnD,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;SACP,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,KAAK;gBACL,KAAK;gBACL,QAAQ,EAAE,aAAa,IAAI,QAAQ;gBACnC,QAAQ;gBACR,OAAO;gBACP,IAAI;aACL,CAAC;YACF,OAAO,KAAC,eAAe,OAAiB,UAAU,IAArB,KAAK,CAAoB,CAAC;QACzD,CAAC,CAAC,GACmB,CACxB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ItemRenderer } from '@blueprintjs/select';
|
|
3
|
+
export declare function useSelect<T extends {
|
|
4
|
+
label: string;
|
|
5
|
+
}>(): {
|
|
6
|
+
value: T | null;
|
|
7
|
+
setValue: import("react").Dispatch<import("react").SetStateAction<T | null>>;
|
|
8
|
+
itemRenderer: ItemRenderer<T>;
|
|
9
|
+
onItemSelect: import("react").Dispatch<import("react").SetStateAction<T | null>>;
|
|
10
|
+
popoverProps: {
|
|
11
|
+
onOpened: (node: HTMLElement) => void;
|
|
12
|
+
};
|
|
13
|
+
popoverTargetProps: {
|
|
14
|
+
style: {
|
|
15
|
+
display: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
itemPredicate: (query: string, item: T) => boolean;
|
|
19
|
+
itemListPredicate: (query: string, items: T[]) => T[];
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=useSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSelect.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useSelect.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,wBAAgB,SAAS,CAAC,CAAC,SAAS;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE;;;;;;yBAKhC,WAAW;;;;;;;2BAWA,MAAM,QAAQ,CAAC;+BAGX,MAAM,SAAS,CAAC,EAAE;EAerD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { MenuItem } from '@blueprintjs/core';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
export function useSelect() {
|
|
5
|
+
const [value, setValue] = useState(null);
|
|
6
|
+
const itemRenderer = getItemRenderer(value);
|
|
7
|
+
const onItemSelect = setValue;
|
|
8
|
+
const popoverProps = {
|
|
9
|
+
onOpened: (node) => {
|
|
10
|
+
const firstUl = node.querySelector('ul');
|
|
11
|
+
if (firstUl) {
|
|
12
|
+
firstUl.tabIndex = 0;
|
|
13
|
+
firstUl.focus();
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const popoverTargetProps = {
|
|
18
|
+
style: { display: 'inline-block' },
|
|
19
|
+
};
|
|
20
|
+
const itemPredicate = (query, item) => {
|
|
21
|
+
return item.label.toLowerCase().includes(query.toLowerCase());
|
|
22
|
+
};
|
|
23
|
+
const itemListPredicate = (query, items) => {
|
|
24
|
+
return items.filter((item) => item.label.toLowerCase().includes(query.toLowerCase()));
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
value,
|
|
28
|
+
setValue,
|
|
29
|
+
itemRenderer,
|
|
30
|
+
onItemSelect,
|
|
31
|
+
popoverProps,
|
|
32
|
+
popoverTargetProps,
|
|
33
|
+
itemPredicate,
|
|
34
|
+
itemListPredicate,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function getItemRenderer(value) {
|
|
38
|
+
const render = ({ label }, { handleClick, handleFocus, modifiers, index }) => (_jsx(MenuItem, { active: modifiers.active, disabled: modifiers.disabled, selected: value?.label === label, onClick: handleClick, onFocus: handleFocus, roleStructure: "listoption", text: label }, index));
|
|
39
|
+
return render;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=useSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSelect.js","sourceRoot":"","sources":["../../../src/components/hooks/useSelect.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,UAAU,SAAS;IACvB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAW,IAAI,CAAC,CAAC;IACnD,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,QAAQ,CAAC;IAC9B,MAAM,YAAY,GAAG;QACnB,QAAQ,EAAE,CAAC,IAAiB,EAAE,EAAE;YAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YACzC,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;gBACrB,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,CAAC;QACH,CAAC;KACF,CAAC;IACF,MAAM,kBAAkB,GAAG;QACzB,KAAK,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;KACnC,CAAC;IACF,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,IAAO,EAAE,EAAE;QAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAChE,CAAC,CAAC;IACF,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,KAAU,EAAE,EAAE;QACtD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAC3B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CACvD,CAAC;IACJ,CAAC,CAAC;IACF,OAAO;QACL,KAAK;QACL,QAAQ;QACR,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,kBAAkB;QAClB,aAAa;QACb,iBAAiB;KAClB,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAA8B,KAAe;IACnE,MAAM,MAAM,GAAoB,CAC9B,EAAE,KAAK,EAAE,EACT,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,EAC9C,EAAE,CAAC,CACH,KAAC,QAAQ,IACP,MAAM,EAAE,SAAS,CAAC,MAAM,EACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAC5B,QAAQ,EAAE,KAAK,EAAE,KAAK,KAAK,KAAK,EAEhC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,aAAa,EAAC,YAAY,EAC1B,IAAI,EAAE,KAAK,IAJN,KAAK,CAKV,CACH,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
|
-
import { Intent, PopoverProps } from '@blueprintjs/core';
|
|
2
|
+
import { Intent, PopoverProps, TagProps } from '@blueprintjs/core';
|
|
3
3
|
import { IconName } from '@blueprintjs/icons';
|
|
4
4
|
import { JSX, ReactElement, ReactNode } from 'react';
|
|
5
|
+
export type PopoverInteractionType = 'click' | 'hover' | 'click-target' | 'hover-target';
|
|
5
6
|
interface ToolbarBaseProps {
|
|
6
7
|
intent?: Intent;
|
|
7
8
|
disabled?: boolean;
|
|
@@ -10,6 +11,7 @@ export interface ToolbarProps extends ToolbarBaseProps {
|
|
|
10
11
|
vertical?: boolean;
|
|
11
12
|
large?: boolean;
|
|
12
13
|
children?: Array<ReactElement<ToolbarItemProps>> | ReactElement<ToolbarItemProps> | Iterable<ReactNode> | boolean | null;
|
|
14
|
+
popoverInteractionKind?: PopoverInteractionType;
|
|
13
15
|
}
|
|
14
16
|
export interface ToolbarItemProps extends ToolbarBaseProps {
|
|
15
17
|
id?: string;
|
|
@@ -20,6 +22,8 @@ export interface ToolbarItemProps extends ToolbarBaseProps {
|
|
|
20
22
|
className?: string;
|
|
21
23
|
noTooltip?: boolean;
|
|
22
24
|
isPopover?: boolean;
|
|
25
|
+
tag?: ReactNode;
|
|
26
|
+
tagProps?: Omit<TagProps, 'children'>;
|
|
23
27
|
}
|
|
24
28
|
export interface ToolbarPopoverItemProps extends PopoverProps {
|
|
25
29
|
itemProps: ToolbarItemProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAIL,MAAM,EAEN,YAAY,
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAIL,MAAM,EAEN,YAAY,EACZ,QAAQ,EAET,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAEL,GAAG,EACH,YAAY,EACZ,SAAS,EAIV,MAAM,OAAO,CAAC;AAUf,MAAM,MAAM,sBAAsB,GAC9B,OAAO,GACP,OAAO,GACP,cAAc,GACd,cAAc,CAAC;AAEnB,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;I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