@neo4j-ndl/react 3.9.4 → 3.9.5
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/spotlight/stories/index.js +59 -0
- package/lib/cjs/spotlight/stories/index.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-fixed-positioning.story.js +48 -0
- package/lib/cjs/spotlight/stories/spotlight-fixed-positioning.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-in-dialog.story.js +49 -0
- package/lib/cjs/spotlight/stories/spotlight-in-dialog.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-in-side-nav.story.js +53 -0
- package/lib/cjs/spotlight/stories/spotlight-in-side-nav.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-tour.story.js +46 -0
- package/lib/cjs/spotlight/stories/spotlight-tour.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-with-icon.story.js +49 -0
- package/lib/cjs/spotlight/stories/spotlight-with-icon.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-with-image.story.js +48 -0
- package/lib/cjs/spotlight/stories/spotlight-with-image.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-with-label.story.js +48 -0
- package/lib/cjs/spotlight/stories/spotlight-with-label.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-with-pointer.story.js +48 -0
- package/lib/cjs/spotlight/stories/spotlight-with-pointer.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight.stories.js +163 -0
- package/lib/cjs/spotlight/stories/spotlight.stories.js.map +1 -0
- package/lib/esm/spotlight/stories/index.js +45 -0
- package/lib/esm/spotlight/stories/index.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-fixed-positioning.story.js +46 -0
- package/lib/esm/spotlight/stories/spotlight-fixed-positioning.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-in-dialog.story.js +47 -0
- package/lib/esm/spotlight/stories/spotlight-in-dialog.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-in-side-nav.story.js +51 -0
- package/lib/esm/spotlight/stories/spotlight-in-side-nav.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-tour.story.js +44 -0
- package/lib/esm/spotlight/stories/spotlight-tour.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-with-icon.story.js +47 -0
- package/lib/esm/spotlight/stories/spotlight-with-icon.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-with-image.story.js +46 -0
- package/lib/esm/spotlight/stories/spotlight-with-image.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-with-label.story.js +46 -0
- package/lib/esm/spotlight/stories/spotlight-with-label.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-with-pointer.story.js +46 -0
- package/lib/esm/spotlight/stories/spotlight-with-pointer.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight.stories.js +157 -0
- package/lib/esm/spotlight/stories/spotlight.stories.js.map +1 -0
- package/lib/types/spotlight/stories/index.d.ts +36 -0
- package/lib/types/spotlight/stories/spotlight-fixed-positioning.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight-in-dialog.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight-in-side-nav.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight-tour.story.d.ts +23 -0
- package/lib/types/spotlight/stories/spotlight-with-icon.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight-with-image.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight-with-label.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight-with-pointer.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight.stories.d.ts +36 -0
- package/package.json +2 -2
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SpotlightFixedPositioningSrc = exports.SpotlightInDialogSrc = exports.SpotlightInSideNavSrc = exports.SpotlightTourSrc = exports.SpotlightWithPointerSrc = exports.SpotlightWithImageSrc = exports.SpotlightWithIconSrc = exports.SpotlightWithLabelSrc = exports.SpotlightFixedPositioning = exports.SpotlightInDialog = exports.SpotlightInSideNav = exports.SpotlightTour = exports.SpotlightWithPointer = exports.SpotlightWithImage = exports.SpotlightWithIcon = exports.SpotlightWithLabel = void 0;
|
|
27
|
+
var spotlight_with_label_story_1 = require("./spotlight-with-label.story");
|
|
28
|
+
Object.defineProperty(exports, "SpotlightWithLabel", { enumerable: true, get: function () { return __importDefault(spotlight_with_label_story_1).default; } });
|
|
29
|
+
var spotlight_with_icon_story_1 = require("./spotlight-with-icon.story");
|
|
30
|
+
Object.defineProperty(exports, "SpotlightWithIcon", { enumerable: true, get: function () { return __importDefault(spotlight_with_icon_story_1).default; } });
|
|
31
|
+
var spotlight_with_image_story_1 = require("./spotlight-with-image.story");
|
|
32
|
+
Object.defineProperty(exports, "SpotlightWithImage", { enumerable: true, get: function () { return __importDefault(spotlight_with_image_story_1).default; } });
|
|
33
|
+
var spotlight_with_pointer_story_1 = require("./spotlight-with-pointer.story");
|
|
34
|
+
Object.defineProperty(exports, "SpotlightWithPointer", { enumerable: true, get: function () { return __importDefault(spotlight_with_pointer_story_1).default; } });
|
|
35
|
+
var spotlight_tour_story_1 = require("./spotlight-tour.story");
|
|
36
|
+
Object.defineProperty(exports, "SpotlightTour", { enumerable: true, get: function () { return __importDefault(spotlight_tour_story_1).default; } });
|
|
37
|
+
var spotlight_in_side_nav_story_1 = require("./spotlight-in-side-nav.story");
|
|
38
|
+
Object.defineProperty(exports, "SpotlightInSideNav", { enumerable: true, get: function () { return __importDefault(spotlight_in_side_nav_story_1).default; } });
|
|
39
|
+
var spotlight_in_dialog_story_1 = require("./spotlight-in-dialog.story");
|
|
40
|
+
Object.defineProperty(exports, "SpotlightInDialog", { enumerable: true, get: function () { return __importDefault(spotlight_in_dialog_story_1).default; } });
|
|
41
|
+
var spotlight_fixed_positioning_story_1 = require("./spotlight-fixed-positioning.story");
|
|
42
|
+
Object.defineProperty(exports, "SpotlightFixedPositioning", { enumerable: true, get: function () { return __importDefault(spotlight_fixed_positioning_story_1).default; } });
|
|
43
|
+
const spotlight_fixed_positioning_story_raw_1 = __importDefault(require("./spotlight-fixed-positioning.story?raw"));
|
|
44
|
+
const spotlight_in_dialog_story_raw_1 = __importDefault(require("./spotlight-in-dialog.story?raw"));
|
|
45
|
+
const spotlight_in_side_nav_story_raw_1 = __importDefault(require("./spotlight-in-side-nav.story?raw"));
|
|
46
|
+
const spotlight_tour_story_raw_1 = __importDefault(require("./spotlight-tour.story?raw"));
|
|
47
|
+
const spotlight_with_icon_story_raw_1 = __importDefault(require("./spotlight-with-icon.story?raw"));
|
|
48
|
+
const spotlight_with_image_story_raw_1 = __importDefault(require("./spotlight-with-image.story?raw"));
|
|
49
|
+
const spotlight_with_label_story_raw_1 = __importDefault(require("./spotlight-with-label.story?raw"));
|
|
50
|
+
const spotlight_with_pointer_story_raw_1 = __importDefault(require("./spotlight-with-pointer.story?raw"));
|
|
51
|
+
exports.SpotlightWithLabelSrc = spotlight_with_label_story_raw_1.default.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
52
|
+
exports.SpotlightWithIconSrc = spotlight_with_icon_story_raw_1.default.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
53
|
+
exports.SpotlightWithImageSrc = spotlight_with_image_story_raw_1.default.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
54
|
+
exports.SpotlightWithPointerSrc = spotlight_with_pointer_story_raw_1.default.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
55
|
+
exports.SpotlightTourSrc = spotlight_tour_story_raw_1.default.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
56
|
+
exports.SpotlightInSideNavSrc = spotlight_in_side_nav_story_raw_1.default.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
57
|
+
exports.SpotlightInDialogSrc = spotlight_in_dialog_story_raw_1.default.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
58
|
+
exports.SpotlightFixedPositioningSrc = spotlight_fixed_positioning_story_raw_1.default.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,2EAA6E;AAApE,iJAAA,OAAO,OAAsB;AACtC,yEAA2E;AAAlE,+IAAA,OAAO,OAAqB;AACrC,2EAA6E;AAApE,iJAAA,OAAO,OAAsB;AACtC,+EAAiF;AAAxE,qJAAA,OAAO,OAAwB;AACxC,+DAAkE;AAAzD,sIAAA,OAAO,OAAiB;AACjC,6EAA8E;AAArE,kJAAA,OAAO,OAAsB;AACtC,yEAA2E;AAAlE,+IAAA,OAAO,OAAqB;AACrC,yFAA2F;AAAlF,+JAAA,OAAO,OAA6B;AAE7C,oHAAsF;AACtF,oGAAsE;AACtE,wGAAyE;AACzE,0FAA6D;AAC7D,oGAAsE;AACtE,sGAAwE;AACxE,sGAAwE;AACxE,0GAA4E;AAE/D,QAAA,qBAAqB,GAAG,wCAAwB,CAAC,OAAO,CACnE,sBAAsB,EACtB,EAAE,CACH,CAAC;AACW,QAAA,oBAAoB,GAAG,uCAAuB,CAAC,OAAO,CACjE,sBAAsB,EACtB,EAAE,CACH,CAAC;AACW,QAAA,qBAAqB,GAAG,wCAAwB,CAAC,OAAO,CACnE,sBAAsB,EACtB,EAAE,CACH,CAAC;AACW,QAAA,uBAAuB,GAAG,0CAA0B,CAAC,OAAO,CACvE,sBAAsB,EACtB,EAAE,CACH,CAAC;AACW,QAAA,gBAAgB,GAAG,kCAAmB,CAAC,OAAO,CACzD,sBAAsB,EACtB,EAAE,CACH,CAAC;AACW,QAAA,qBAAqB,GAAG,yCAAwB,CAAC,OAAO,CACnE,sBAAsB,EACtB,EAAE,CACH,CAAC;AACW,QAAA,oBAAoB,GAAG,uCAAuB,CAAC,OAAO,CACjE,sBAAsB,EACtB,EAAE,CACH,CAAC;AACW,QAAA,4BAA4B,GACvC,+CAA+B,CAAC,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const react_2 = require("react");
|
|
27
|
+
const Component = (props) => {
|
|
28
|
+
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
29
|
+
const { setIsOpen, setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
30
|
+
const targetId = `test-target-${themeClassName}`;
|
|
31
|
+
(0, react_2.useEffect)(() => {
|
|
32
|
+
if (props.isChromatic) {
|
|
33
|
+
setActiveSpotlight(targetId);
|
|
34
|
+
setIsOpen(true);
|
|
35
|
+
}
|
|
36
|
+
}, [setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-justify-center n-gap-token-10 n-h-[100px]", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)("div", { className: "n-left-[auto] n-top-[110px] n-fixed", children: (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, backgroundColor: "rgb(var(--theme-palette-neutral-bg-weak))", indicatorVariant: "border", indicatorPlacement: "middle-middle", children: (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => alert('Target button clicked'), children: "Target" }) }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: [
|
|
38
|
+
{
|
|
39
|
+
label: 'Close',
|
|
40
|
+
onClick: () => {
|
|
41
|
+
setIsOpen(false);
|
|
42
|
+
setActiveSpotlight(null);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
], children: [(0, jsx_runtime_1.jsx)(react_1.Spotlight.Header, { children: "This is a header" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Body, { children: "This is content" })] })] }));
|
|
46
|
+
};
|
|
47
|
+
exports.default = Component;
|
|
48
|
+
//# sourceMappingURL=spotlight-fixed-positioning.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-fixed-positioning.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-fixed-positioning.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAM0B;AAC1B,iCAAkC;AAMlC,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,sBAAc,GAAE,CAAC;IAC5C,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAEhE,MAAM,QAAQ,GAAG,eAAe,cAAc,EAAE,CAAC;IAEjD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAEjE,OAAO,CACL,iCAAK,SAAS,EAAC,oDAAoD,aACjE,uBAAC,cAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACT,gCAAK,SAAS,EAAC,qCAAqC,YAClD,uBAAC,uBAAe,IACd,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,CAAC,KAAK,CAAC,WAAW,EAC5B,YAAY,EAAE,CAAC,EACf,eAAe,EAAC,2CAA2C,EAC3D,gBAAgB,EAAC,QAAQ,EACzB,kBAAkB,EAAC,eAAe,YAElC,uBAAC,cAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,uBAAiB,GACtD,GACd,EACN,wBAAC,iBAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,OAAO;wBACd,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,KAAK,CAAC,CAAC;4BACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;wBAC3B,CAAC;qBACF;iBACF,aAED,uBAAC,iBAAS,CAAC,MAAM,mCAAoC,EACrD,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IACtC,IACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const react_2 = require("react");
|
|
27
|
+
const Component = (props) => {
|
|
28
|
+
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
29
|
+
const { setIsOpen, setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
30
|
+
const [isModalOpen, setIsModalOpen] = (0, react_2.useState)(props.isChromatic);
|
|
31
|
+
const targetId = `test-target-${themeClassName}`;
|
|
32
|
+
(0, react_2.useEffect)(() => {
|
|
33
|
+
if (props.isChromatic && isModalOpen) {
|
|
34
|
+
setActiveSpotlight(targetId);
|
|
35
|
+
setIsOpen(true);
|
|
36
|
+
}
|
|
37
|
+
}, [isModalOpen, setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-justify-center n-gap-token-10", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => setIsModalOpen(true), children: "Open Modal" }), (0, jsx_runtime_1.jsxs)(react_1.Dialog, { isOpen: isModalOpen, onClose: () => setIsModalOpen(false), "aria-label": "Dialog", modalProps: { className: themeClassName }, children: [(0, jsx_runtime_1.jsx)(react_1.Dialog.Header, { children: "Using Spotlight inside a modal" }), (0, jsx_runtime_1.jsxs)(react_1.Dialog.Description, { className: "n-flex n-flex-col n-gap-token-8", children: [(0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-medium", children: "Make sure to set hasAnchorPortal to true for both Spotlight and SpotlightTarget when the target is in a Dialog" }), (0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-justify-center n-gap-token-10", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, backgroundColor: "rgb(var(--theme-palette-neutral-bg-weak))", indicatorVariant: "border", hasAnchorPortal: true, children: (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => alert('Target button clicked'), children: "Target" }) })] })] }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", hasAnchorPortal: true, target: targetId, actions: [
|
|
39
|
+
{
|
|
40
|
+
label: 'Close',
|
|
41
|
+
onClick: () => {
|
|
42
|
+
setIsOpen(false);
|
|
43
|
+
setActiveSpotlight(null);
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
], children: [(0, jsx_runtime_1.jsx)(react_1.Spotlight.Header, { children: "This is a header" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Body, { children: "This is content" })] })] })] }));
|
|
47
|
+
};
|
|
48
|
+
exports.default = Component;
|
|
49
|
+
//# sourceMappingURL=spotlight-in-dialog.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-in-dialog.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-in-dialog.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAQ0B;AAC1B,iCAA4C;AAM5C,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,sBAAc,GAAE,CAAC;IAC5C,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,IAAA,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B,uBAAC,cAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,uBAE5C,GACO,IACd,IACa,EACrB,wBAAC,iBAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,eAAe,EAAE,IAAI,EACrB,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE;4BACP;gCACE,KAAK,EAAE,OAAO;gCACd,OAAO,EAAE,GAAG,EAAE;oCACZ,SAAS,CAAC,KAAK,CAAC,CAAC;oCACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;gCAC3B,CAAC;6BACF;yBACF,aAED,uBAAC,iBAAS,CAAC,MAAM,mCAAoC,EACrD,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IACtC,IACL,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const next_1 = require("@neo4j-ndl/react/next");
|
|
27
|
+
const react_2 = require("react");
|
|
28
|
+
const Component = (props) => {
|
|
29
|
+
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
30
|
+
const { setActiveSpotlight, setIsOpen } = (0, react_1.useSpotlightContext)();
|
|
31
|
+
const [isSelected, setIsSelected] = (0, react_2.useState)('aura-db-instances');
|
|
32
|
+
const targetId = `test-target-${themeClassName}`;
|
|
33
|
+
const handleClick = (item) => {
|
|
34
|
+
setIsSelected(item);
|
|
35
|
+
};
|
|
36
|
+
(0, react_2.useEffect)(() => {
|
|
37
|
+
if (props.isChromatic) {
|
|
38
|
+
setActiveSpotlight(targetId);
|
|
39
|
+
setIsOpen(true);
|
|
40
|
+
}
|
|
41
|
+
}, [setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-h-[500px] n-flex", children: [(0, jsx_runtime_1.jsx)(next_1.SideNavigation, { isExpanded: true, children: (0, jsx_runtime_1.jsxs)(next_1.SideNavigation.List, { children: [(0, jsx_runtime_1.jsx)(next_1.SideNavigation.CategoryHeader, { children: "AuraDB" }), (0, jsx_runtime_1.jsx)(next_1.SideNavigation.NavItem, { as: "button", onClick: () => handleClick('aura-db-instances'), isSelected: isSelected === 'aura-db-instances', label: "Instances" }), (0, jsx_runtime_1.jsx)(next_1.SideNavigation.NavItem, { as: "button", onClick: () => handleClick('aura-db-connect'), isSelected: isSelected === 'aura-db-connect', label: "Connect" }), (0, jsx_runtime_1.jsxs)(next_1.SideNavigation.List, { children: [(0, jsx_runtime_1.jsx)(next_1.SideNavigation.NavItem, { as: "button", onClick: () => handleClick('aura-db-python'), isSelected: isSelected === 'aura-db-python', label: "Python" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { as: "li", id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, backgroundColor: "rgb(var(--theme-palette-neutral-bg-weak))", indicatorVariant: "point", indicatorPlacement: "top-right", children: (0, jsx_runtime_1.jsx)(next_1.SideNavigation.NavItem, { as: "button", onClick: () => handleClick('aura-db-javascript'), isSelected: isSelected === 'aura-db-javascript', label: "JavaScript" }) })] }), (0, jsx_runtime_1.jsx)(next_1.SideNavigation.CategoryHeader, { children: "AuraDS" }), (0, jsx_runtime_1.jsxs)(next_1.SideNavigation.List, { children: [(0, jsx_runtime_1.jsx)(next_1.SideNavigation.NavItem, { as: "button", onClick: () => handleClick('aura-ds-instances'), isSelected: isSelected === 'aura-ds-instances', label: "Instances" }), (0, jsx_runtime_1.jsx)(next_1.SideNavigation.NavItem, { as: "button", onClick: () => handleClick('aura-ds-getting-started'), isSelected: isSelected === 'aura-ds-getting-started', label: "Getting Started" })] })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "n-w-full n-h-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-6", children: (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "top-end-top-start", target: targetId, actions: [
|
|
43
|
+
{
|
|
44
|
+
label: 'Close',
|
|
45
|
+
onClick: () => {
|
|
46
|
+
setIsOpen(false);
|
|
47
|
+
setActiveSpotlight(null);
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
], children: [(0, jsx_runtime_1.jsx)(react_1.Spotlight.Header, { children: "This is a header" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Body, { children: "This is content" })] })] }));
|
|
51
|
+
};
|
|
52
|
+
exports.default = Component;
|
|
53
|
+
//# sourceMappingURL=spotlight-in-side-nav.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-in-side-nav.story.js","sourceRoot":"","sources":["../../../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iBAAiB,GACvB,IACkB,IACF,GACP,EACjB,gCAAK,SAAS,EAAC,8FAA8F,YAC3G,uBAAC,cAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,GACL,EACN,wBAAC,iBAAS,IACR,SAAS,EAAC,mBAAmB,EAC7B,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,OAAO;wBACd,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,KAAK,CAAC,CAAC;4BACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;wBAC3B,CAAC;qBACF;iBACF,aAED,uBAAC,iBAAS,CAAC,MAAM,mCAAoC,EACrD,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IACtC,IACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const icons_1 = require("@neo4j-ndl/react/icons");
|
|
27
|
+
const Component = () => {
|
|
28
|
+
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
29
|
+
const { setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-justify-center n-gap-token-10", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { fill: "outlined", onClick: () => setActiveSpotlight(`test-target-1-${themeClassName}`), children: "Start tour" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: `test-target-1-${themeClassName}`, hasPulse: true, borderRadius: 4, children: (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => alert('Target 1 clicked'), children: "Target 1" }) }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: `test-target-2-${themeClassName}`, hasPulse: true, borderRadius: 4, children: (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => alert('Target 2 clicked'), children: "Target 2" }) }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: `test-target-3-${themeClassName}`, hasPulse: true, borderRadius: 4, children: (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => alert('Target 3 clicked'), children: "Target 3" }) }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTour, { onAction: (target, action) => console.info(`Action ${action} was performed in spotlight ${target}`), spotlights: [
|
|
31
|
+
{
|
|
32
|
+
children: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Spotlight.Label, { children: "NEW" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Header, { children: "This is a header" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Body, { children: "This is content" })] })),
|
|
33
|
+
target: `test-target-1-${themeClassName}`,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
children: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Spotlight.IconWrapper, { children: (0, jsx_runtime_1.jsx)(icons_1.FingerPrintIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Header, { children: "This is a header" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Body, { children: "This is content" })] })),
|
|
37
|
+
target: `test-target-2-${themeClassName}`,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
children: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Spotlight.Image, { src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjY2NjIi8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSIxNCIgZmlsbD0iIzMzMyIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkV4YW1wbGUgSW1hZ2U8L3RleHQ+PC9zdmc+", alt: "example image" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Body, { children: "This is content" })] })),
|
|
41
|
+
target: `test-target-3-${themeClassName}`,
|
|
42
|
+
},
|
|
43
|
+
] })] }));
|
|
44
|
+
};
|
|
45
|
+
exports.default = Component;
|
|
46
|
+
//# sourceMappingURL=spotlight-tour.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-tour.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-tour.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;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MAAM,mCAAoC,EACrD,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IAC/C,CACJ;wBACD,MAAM,EAAE,iBAAiB,cAAc,EAAE;qBAC1C;oBACD;wBACE,QAAQ,EAAE,CACR,6DACE,uBAAC,iBAAS,CAAC,WAAW,cACpB,uBAAC,8BAAsB,KAAG,GACJ,EACxB,uBAAC,iBAAS,CAAC,MAAM,mCAAoC,EACrD,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IAC/C,CACJ;wBACD,MAAM,EAAE,iBAAiB,cAAc,EAAE;qBAC1C;oBACD;wBACE,QAAQ,EAAE,CACR,6DACE,uBAAC,iBAAS,CAAC,KAAK,IACd,GAAG,EAAC,wVAAwV,EAC5V,GAAG,EAAC,eAAe,GACnB,EACF,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IAC/C,CACJ;wBACD,MAAM,EAAE,iBAAiB,cAAc,EAAE;qBAC1C;iBACF,GACD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const icons_1 = require("@neo4j-ndl/react/icons");
|
|
27
|
+
const react_2 = require("react");
|
|
28
|
+
const Component = (props) => {
|
|
29
|
+
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
30
|
+
const { setIsOpen, setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
31
|
+
const targetId = `test-target-${themeClassName}`;
|
|
32
|
+
(0, react_2.useEffect)(() => {
|
|
33
|
+
if (props.isChromatic) {
|
|
34
|
+
setActiveSpotlight(targetId);
|
|
35
|
+
setIsOpen(true);
|
|
36
|
+
}
|
|
37
|
+
}, [setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-justify-center n-gap-token-10", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, backgroundColor: "rgb(var(--theme-palette-neutral-bg-weak))", indicatorVariant: "border", children: (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => alert('Target button clicked'), fill: "text", children: "Target" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: [
|
|
39
|
+
{
|
|
40
|
+
label: 'Close',
|
|
41
|
+
onClick: () => {
|
|
42
|
+
setIsOpen(false);
|
|
43
|
+
setActiveSpotlight(null);
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
], children: [(0, jsx_runtime_1.jsx)(react_1.Spotlight.IconWrapper, { children: (0, jsx_runtime_1.jsx)(icons_1.FingerPrintIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Header, { children: "This is a header" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Body, { children: "This is content" })] })] }));
|
|
47
|
+
};
|
|
48
|
+
exports.default = Component;
|
|
49
|
+
//# sourceMappingURL=spotlight-with-icon.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-with-icon.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-with-icon.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAM0B;AAC1B,kDAAgE;AAChE,iCAAkC;AAMlC,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,sBAAc,GAAE,CAAC;IAC5C,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAEhE,MAAM,QAAQ,GAAG,eAAe,cAAc,EAAE,CAAC;IAEjD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAEjE,OAAO,CACL,iCAAK,SAAS,EAAC,wCAAwC,aACrD,uBAAC,cAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACT,uBAAC,uBAAe,IACd,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,CAAC,KAAK,CAAC,WAAW,EAC5B,YAAY,EAAE,CAAC,EACf,eAAe,EAAC,2CAA2C,EAC3D,gBAAgB,EAAC,QAAQ,YAEzB,uBAAC,cAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAC,MAAM,uBAEzD,GACO,EAClB,wBAAC,iBAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,OAAO;wBACd,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,KAAK,CAAC,CAAC;4BACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;wBAC3B,CAAC;qBACF;iBACF,aAED,uBAAC,iBAAS,CAAC,WAAW,cACpB,uBAAC,8BAAsB,KAAG,GACJ,EACxB,uBAAC,iBAAS,CAAC,MAAM,mCAAoC,EACrD,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IACtC,IACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const react_2 = require("react");
|
|
27
|
+
const Component = (props) => {
|
|
28
|
+
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
29
|
+
const { setIsOpen, setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
30
|
+
const targetId = `test-target-${themeClassName}`;
|
|
31
|
+
(0, react_2.useEffect)(() => {
|
|
32
|
+
if (props.isChromatic) {
|
|
33
|
+
setActiveSpotlight(targetId);
|
|
34
|
+
setIsOpen(true);
|
|
35
|
+
}
|
|
36
|
+
}, [setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-justify-center n-gap-token-10", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, backgroundColor: "rgb(var(--theme-palette-neutral-bg-weak))", children: (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => alert('Target button clicked'), fill: "text", children: "Target" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: [
|
|
38
|
+
{
|
|
39
|
+
label: 'Close',
|
|
40
|
+
onClick: () => {
|
|
41
|
+
setIsOpen(false);
|
|
42
|
+
setActiveSpotlight(null);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
], children: [(0, jsx_runtime_1.jsx)(react_1.Spotlight.Image, { src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjY2NjIi8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSIxNCIgZmlsbD0iIzMzMyIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkV4YW1wbGUgSW1hZ2U8L3RleHQ+PC9zdmc+", alt: "example image" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Header, { children: "This is a header" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Body, { children: "This is content" })] })] }));
|
|
46
|
+
};
|
|
47
|
+
exports.default = Component;
|
|
48
|
+
//# sourceMappingURL=spotlight-with-image.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-with-image.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-with-image.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAM0B;AAC1B,iCAAkC;AAMlC,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,sBAAc,GAAE,CAAC;IAC5C,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAEhE,MAAM,QAAQ,GAAG,eAAe,cAAc,EAAE,CAAC;IAEjD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAEjE,OAAO,CACL,iCAAK,SAAS,EAAC,wCAAwC,aACrD,uBAAC,cAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACT,uBAAC,uBAAe,IACd,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,CAAC,KAAK,CAAC,WAAW,EAC5B,YAAY,EAAE,CAAC,EACf,eAAe,EAAC,2CAA2C,YAE3D,uBAAC,cAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAC,MAAM,uBAEzD,GACO,EAClB,wBAAC,iBAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,OAAO;wBACd,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,KAAK,CAAC,CAAC;4BACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;wBAC3B,CAAC;qBACF;iBACF,aAED,uBAAC,iBAAS,CAAC,KAAK,IACd,GAAG,EAAC,wVAAwV,EAC5V,GAAG,EAAC,eAAe,GACnB,EACF,uBAAC,iBAAS,CAAC,MAAM,mCAAoC,EACrD,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IACtC,IACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const react_2 = require("react");
|
|
27
|
+
const Component = (props) => {
|
|
28
|
+
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
29
|
+
const { setIsOpen, setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
30
|
+
const targetId = `test-target-${themeClassName}`;
|
|
31
|
+
(0, react_2.useEffect)(() => {
|
|
32
|
+
if (props.isChromatic) {
|
|
33
|
+
setActiveSpotlight(targetId);
|
|
34
|
+
setIsOpen(true);
|
|
35
|
+
}
|
|
36
|
+
}, [setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-justify-center n-gap-token-10", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, backgroundColor: "rgb(var(--theme-palette-neutral-bg-weak))", indicatorVariant: "border", children: (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => alert('Target button clicked'), fill: "text", children: "Target" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: [
|
|
38
|
+
{
|
|
39
|
+
label: 'Close',
|
|
40
|
+
onClick: () => {
|
|
41
|
+
setIsOpen(false);
|
|
42
|
+
setActiveSpotlight(null);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
], children: [(0, jsx_runtime_1.jsx)(react_1.Spotlight.Label, { children: "NEW" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Header, { children: "This is a header" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Body, { children: "This is content" })] })] }));
|
|
46
|
+
};
|
|
47
|
+
exports.default = Component;
|
|
48
|
+
//# sourceMappingURL=spotlight-with-label.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-with-label.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-with-label.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAM0B;AAC1B,iCAAkC;AAMlC,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,sBAAc,GAAE,CAAC;IAC5C,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAEhE,MAAM,QAAQ,GAAG,eAAe,cAAc,EAAE,CAAC;IAEjD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAEjE,OAAO,CACL,iCAAK,SAAS,EAAC,wCAAwC,aACrD,uBAAC,cAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACT,uBAAC,uBAAe,IACd,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,CAAC,KAAK,CAAC,WAAW,EAC5B,YAAY,EAAE,CAAC,EACf,eAAe,EAAC,2CAA2C,EAC3D,gBAAgB,EAAC,QAAQ,YAEzB,uBAAC,cAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAC,MAAM,uBAEzD,GACO,EAClB,wBAAC,iBAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,OAAO;wBACd,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,KAAK,CAAC,CAAC;4BACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;wBAC3B,CAAC;qBACF;iBACF,aAED,uBAAC,iBAAS,CAAC,KAAK,sBAAsB,EACtC,uBAAC,iBAAS,CAAC,MAAM,mCAAoC,EACrD,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IACtC,IACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const react_2 = require("react");
|
|
27
|
+
const Component = (props) => {
|
|
28
|
+
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
29
|
+
const { setIsOpen, setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
30
|
+
const targetId = `test-target-${themeClassName}`;
|
|
31
|
+
(0, react_2.useEffect)(() => {
|
|
32
|
+
if (props.isChromatic) {
|
|
33
|
+
setActiveSpotlight(targetId);
|
|
34
|
+
setIsOpen(true);
|
|
35
|
+
}
|
|
36
|
+
}, [setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-justify-center n-gap-token-10", children: [(0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, backgroundColor: "rgb(var(--theme-palette-neutral-bg-weak))", indicatorVariant: "point", indicatorPlacement: "top-right", children: (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => alert('Target button clicked'), children: "Target" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: [
|
|
38
|
+
{
|
|
39
|
+
label: 'Close',
|
|
40
|
+
onClick: () => {
|
|
41
|
+
setIsOpen(false);
|
|
42
|
+
setActiveSpotlight(null);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
], children: [(0, jsx_runtime_1.jsx)(react_1.Spotlight.Header, { children: "This is a header" }), (0, jsx_runtime_1.jsx)(react_1.Spotlight.Body, { children: "This is content" })] })] }));
|
|
46
|
+
};
|
|
47
|
+
exports.default = Component;
|
|
48
|
+
//# sourceMappingURL=spotlight-with-pointer.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-with-pointer.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-with-pointer.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAM0B;AAC1B,iCAAkC;AAMlC,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,sBAAc,GAAE,CAAC;IAC5C,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAEhE,MAAM,QAAQ,GAAG,eAAe,cAAc,EAAE,CAAC;IAEjD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAEjE,OAAO,CACL,iCAAK,SAAS,EAAC,wCAAwC,aACrD,uBAAC,cAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACT,uBAAC,uBAAe,IACd,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,CAAC,KAAK,CAAC,WAAW,EAC5B,YAAY,EAAE,CAAC,EACf,eAAe,EAAC,2CAA2C,EAC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