@neo4j-ndl/react 3.1.7 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/context-menu/ContextMenu.js +9 -9
- package/lib/cjs/context-menu/ContextMenu.js.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/spotlight/Spotlight.js +137 -0
- package/lib/cjs/spotlight/Spotlight.js.map +1 -0
- package/lib/cjs/spotlight/SpotlightProvider.js +57 -0
- package/lib/cjs/spotlight/SpotlightProvider.js.map +1 -0
- package/lib/cjs/spotlight/SpotlightTarget.js +58 -0
- package/lib/cjs/spotlight/SpotlightTarget.js.map +1 -0
- package/lib/cjs/spotlight/SpotlightTour.js +138 -0
- package/lib/cjs/spotlight/SpotlightTour.js.map +1 -0
- package/lib/cjs/spotlight/index.js +41 -0
- package/lib/cjs/spotlight/index.js.map +1 -0
- package/lib/esm/context-menu/ContextMenu.js +9 -9
- package/lib/esm/context-menu/ContextMenu.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/spotlight/Spotlight.js +108 -0
- package/lib/esm/spotlight/Spotlight.js.map +1 -0
- package/lib/esm/spotlight/SpotlightProvider.js +49 -0
- package/lib/esm/spotlight/SpotlightProvider.js.map +1 -0
- package/lib/esm/spotlight/SpotlightTarget.js +52 -0
- package/lib/esm/spotlight/SpotlightTarget.js.map +1 -0
- package/lib/esm/spotlight/SpotlightTour.js +134 -0
- package/lib/esm/spotlight/SpotlightTour.js.map +1 -0
- package/lib/esm/spotlight/index.js +25 -0
- package/lib/esm/spotlight/index.js.map +1 -0
- package/lib/types/context-menu/ContextMenu.d.ts +2 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/spotlight/Spotlight.d.ts +84 -0
- package/lib/types/spotlight/SpotlightProvider.d.ts +40 -0
- package/lib/types/spotlight/SpotlightTarget.d.ts +37 -0
- package/lib/types/spotlight/SpotlightTour.d.ts +39 -0
- package/lib/types/spotlight/index.d.ts +24 -0
- package/package.json +2 -2
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import { HtmlAttributes, PolymorphicForwardRefExoticComponent, PolymorphicPropsWithRef } from '../_common/types';
|
|
23
|
+
import { EventTypeLabelProps } from '../label';
|
|
24
|
+
export type SpotlightActionsProps = {
|
|
25
|
+
label: string;
|
|
26
|
+
isDisabled?: boolean;
|
|
27
|
+
fill?: 'text' | 'outlined';
|
|
28
|
+
} & ({
|
|
29
|
+
as: 'button';
|
|
30
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
31
|
+
} | {
|
|
32
|
+
as?: 'a';
|
|
33
|
+
href?: string;
|
|
34
|
+
target?: React.ComponentPropsWithoutRef<'a'>['target'];
|
|
35
|
+
} | {
|
|
36
|
+
as: React.ElementType;
|
|
37
|
+
});
|
|
38
|
+
declare const SpotlightActions: PolymorphicForwardRefExoticComponent<'button', SpotlightActionsProps>;
|
|
39
|
+
type SpotlightHeaderProps = {
|
|
40
|
+
children?: React.ReactNode;
|
|
41
|
+
};
|
|
42
|
+
type SpotlightBodyProps = {
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
};
|
|
45
|
+
type SpotlightLabelProps = Omit<EventTypeLabelProps, 'color' | 'fill'>;
|
|
46
|
+
type SpotlightImageProps = {
|
|
47
|
+
src: string;
|
|
48
|
+
alt: string;
|
|
49
|
+
htmlAttributes?: HtmlAttributes<'img'>;
|
|
50
|
+
className?: string;
|
|
51
|
+
style?: React.CSSProperties;
|
|
52
|
+
};
|
|
53
|
+
type SpotlightIconWrapperProps = {
|
|
54
|
+
children?: React.ReactNode;
|
|
55
|
+
};
|
|
56
|
+
export type SpotlightCloseAction = 'clickOutside' | 'escapeKeyDown';
|
|
57
|
+
export type SpotlightProps = {
|
|
58
|
+
/** Id of the SpotlightTarget where the spotlight should be rendered */
|
|
59
|
+
target: string;
|
|
60
|
+
/** Action buttons in the footer */
|
|
61
|
+
actions?: React.ComponentProps<typeof SpotlightActions>[];
|
|
62
|
+
/** Left bottom corner content */
|
|
63
|
+
beforeActions?: React.ReactNode;
|
|
64
|
+
/** Which element to initially focus. Either a tabbable index or ref */
|
|
65
|
+
initialFocus?: number | React.MutableRefObject<HTMLElement | null>;
|
|
66
|
+
onClose?: (action: SpotlightCloseAction) => void;
|
|
67
|
+
children?: React.ReactNode;
|
|
68
|
+
className?: string;
|
|
69
|
+
style?: React.CSSProperties;
|
|
70
|
+
htmlAttributes?: HtmlAttributes<'div'>;
|
|
71
|
+
};
|
|
72
|
+
declare const Spotlight: Omit<React.ForwardRefExoticComponent<SpotlightProps & {
|
|
73
|
+
[key: string]: unknown;
|
|
74
|
+
}>, "$$typeof"> & Omit<React.ExoticComponent<SpotlightProps & {
|
|
75
|
+
[key: string]: unknown;
|
|
76
|
+
}>, never> & (<InstanceT extends React.ElementType = "div">(props: PolymorphicPropsWithRef<InstanceT, SpotlightProps>) => React.ReactElement | null) & {
|
|
77
|
+
Actions: PolymorphicForwardRefExoticComponent<"button", SpotlightActionsProps>;
|
|
78
|
+
Body: PolymorphicForwardRefExoticComponent<"div", SpotlightBodyProps>;
|
|
79
|
+
Header: PolymorphicForwardRefExoticComponent<"div", SpotlightHeaderProps>;
|
|
80
|
+
IconWrapper: PolymorphicForwardRefExoticComponent<"div", SpotlightIconWrapperProps>;
|
|
81
|
+
Image: React.ForwardRefExoticComponent<SpotlightImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
82
|
+
Label: PolymorphicForwardRefExoticComponent<"div", SpotlightLabelProps>;
|
|
83
|
+
};
|
|
84
|
+
export { Spotlight };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import React from 'react';
|
|
23
|
+
type SpotlightContextType = {
|
|
24
|
+
/** Is true if the spotlight is open */
|
|
25
|
+
isOpen: boolean;
|
|
26
|
+
/** Closes or opens the spotlight */
|
|
27
|
+
setIsOpen: (arg: boolean) => void;
|
|
28
|
+
/** Is true if the provided target is the active spotlight */
|
|
29
|
+
isActiveSpotlight: (target: string) => boolean;
|
|
30
|
+
/** Sets the active spotlight to the provided target. Use null to clear active target */
|
|
31
|
+
setActiveSpotlight: (target: string | null) => void;
|
|
32
|
+
};
|
|
33
|
+
export declare const useSpotlightContext: () => SpotlightContextType;
|
|
34
|
+
type SpotlightProviderProps = {
|
|
35
|
+
children: React.ReactNode;
|
|
36
|
+
/** If the spotlights should have an overlay */
|
|
37
|
+
hasOverlay?: boolean;
|
|
38
|
+
};
|
|
39
|
+
export declare const SpotlightProvider: (props: SpotlightProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import { PolymorphicForwardRefExoticComponent } from '../_common/types';
|
|
23
|
+
type SpotlightTargetProps = {
|
|
24
|
+
/** id of the target. should match with target prop in Spotlight */
|
|
25
|
+
id: string;
|
|
26
|
+
/** if the target should have a pulse animation. default behaviour is true */
|
|
27
|
+
hasPulse?: boolean;
|
|
28
|
+
/** background color */
|
|
29
|
+
backgroundColor?: React.CSSProperties['backgroundColor'];
|
|
30
|
+
/** border radius */
|
|
31
|
+
borderRadius?: React.CSSProperties['borderRadius'];
|
|
32
|
+
/** classnames are only applied when target is active */
|
|
33
|
+
className?: string;
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
};
|
|
36
|
+
export declare const SpotlightTarget: PolymorphicForwardRefExoticComponent<'div', SpotlightTargetProps>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import { Spotlight, SpotlightCloseAction } from './Spotlight';
|
|
23
|
+
type SpotlightTourAction = SpotlightCloseAction | 'dismiss' | 'back' | 'next' | 'close';
|
|
24
|
+
type SpotlightTourProps = {
|
|
25
|
+
/** Array of spotlights */
|
|
26
|
+
spotlights: React.ComponentProps<typeof Spotlight>[];
|
|
27
|
+
/** Text override for dismiss button */
|
|
28
|
+
dismissButtonText?: string;
|
|
29
|
+
/** Text override for back button */
|
|
30
|
+
backButtonText?: string;
|
|
31
|
+
/** Text override for next button */
|
|
32
|
+
nextButtonText?: string;
|
|
33
|
+
/** Text override for close button */
|
|
34
|
+
closeButtonText?: string;
|
|
35
|
+
/** Callback function on button clicks, outside clicks, and escape key down */
|
|
36
|
+
onAction?: (target: string, action: SpotlightTourAction) => void;
|
|
37
|
+
};
|
|
38
|
+
export declare const SpotlightTour: (props: SpotlightTourProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
export * from './Spotlight';
|
|
22
|
+
export * from './SpotlightProvider';
|
|
23
|
+
export * from './SpotlightTarget';
|
|
24
|
+
export * from './SpotlightTour';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@tanstack/react-table": "8.20.5",
|
|
65
65
|
"react": ">=16.8.0",
|
|
66
66
|
"react-dom": ">=16.8.0",
|
|
67
|
-
"@neo4j-ndl/base": "^3.
|
|
67
|
+
"@neo4j-ndl/base": "^3.2.0"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@dnd-kit/core": "6.1.0",
|