UNPKG

@neo4j-ndl/react

Version:

React implementation of Neo4j Design System

46 lines 4.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("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/>. */ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css"); const react_1 = require("@neo4j-ndl/react"); const icons_1 = require("@neo4j-ndl/react/icons"); const Component = () => { const { themeClassName } = (0, react_1.useNeedleTheme)(); const { setActiveSpotlight } = (0, react_1.useSpotlightContext)(); return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-justify-center n-gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => setActiveSpotlight(`test-target-1-${themeClassName}`), children: "Start tour" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: `test-target-1-${themeClassName}`, hasPulse: true, asChild: true, children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => alert('Target 1 clicked'), children: "Target 1" }) }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: `test-target-2-${themeClassName}`, hasPulse: true, asChild: true, children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => alert('Target 2 clicked'), children: "Target 2" }) }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: `test-target-3-${themeClassName}`, hasPulse: true, asChild: true, children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { 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: [ { 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" })] })), target: `test-target-1-${themeClassName}`, }, { 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" })] })), target: `test-target-2-${themeClassName}`, }, { 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" })] })), target: `test-target-3-${themeClassName}`, }, ] })] })); }; exports.default = Component; //# sourceMappingURL=spotlight-tour.story.js.map