@neo4j-ndl/react
Version:
React implementation of Neo4j Design System
44 lines • 3.63 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
/**
*
* Copyright (c) "Neo4j"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
import { FilledButton, OutlinedButton, Spotlight, SpotlightTarget, SpotlightTour, useNeedleTheme, useSpotlightContext, } from '@neo4j-ndl/react';
import { FingerPrintIconOutline } from '@neo4j-ndl/react/icons';
const Component = () => {
const { themeClassName } = useNeedleTheme();
const { setActiveSpotlight } = useSpotlightContext();
return (_jsxs("div", { className: "n-flex n-justify-center n-gap-token-64", children: [_jsx(OutlinedButton, { onClick: () => setActiveSpotlight(`test-target-1-${themeClassName}`), children: "Start tour" }), _jsx(SpotlightTarget, { id: `test-target-1-${themeClassName}`, hasPulse: true, asChild: true, children: _jsx(FilledButton, { onClick: () => alert('Target 1 clicked'), children: "Target 1" }) }), _jsx(SpotlightTarget, { id: `test-target-2-${themeClassName}`, hasPulse: true, asChild: true, children: _jsx(FilledButton, { onClick: () => alert('Target 2 clicked'), children: "Target 2" }) }), _jsx(SpotlightTarget, { id: `test-target-3-${themeClassName}`, hasPulse: true, asChild: true, children: _jsx(FilledButton, { onClick: () => alert('Target 3 clicked'), children: "Target 3" }) }), _jsx(SpotlightTour, { onAction: (target, action) => console.info(`Action ${action} was performed in spotlight ${target}`), spotlights: [
{
children: (_jsxs(_Fragment, { children: [_jsx(Spotlight.Label, { children: "NEW" }), _jsx(Spotlight.Header, { children: "This is a header" }), _jsx(Spotlight.Body, { children: "This is content" })] })),
target: `test-target-1-${themeClassName}`,
},
{
children: (_jsxs(_Fragment, { children: [_jsx(Spotlight.IconWrapper, { children: _jsx(FingerPrintIconOutline, {}) }), _jsx(Spotlight.Header, { children: "This is a header" }), _jsx(Spotlight.Body, { children: "This is content" })] })),
target: `test-target-2-${themeClassName}`,
},
{
children: (_jsxs(_Fragment, { children: [_jsx(Spotlight.Image, { src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjY2NjIi8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSIxNCIgZmlsbD0iIzMzMyIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkV4YW1wbGUgSW1hZ2U8L3RleHQ+PC9zdmc+", alt: "example image" }), _jsx(Spotlight.Body, { children: "This is content" })] })),
target: `test-target-3-${themeClassName}`,
},
] })] }));
};
export default Component;
//# sourceMappingURL=spotlight-tour.story.js.map