@neo4j-ndl/react 5.4.3 → 5.4.4
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/data-grid/stories/datagrid-pinned-columns.stories.js +0 -1
- package/lib/cjs/data-grid/stories/datagrid-pinned-columns.stories.js.map +1 -1
- package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js +0 -1
- package/lib/cjs/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
- package/lib/cjs/select/stories/select-async.story.js +1 -3
- package/lib/cjs/select/stories/select-async.story.js.map +1 -1
- package/lib/cjs/select/stories/select-clean.story.js +1 -3
- package/lib/cjs/select/stories/select-clean.story.js.map +1 -1
- package/lib/cjs/select/stories/select-controlled.story.js +1 -3
- package/lib/cjs/select/stories/select-controlled.story.js.map +1 -1
- package/lib/cjs/select/stories/select-creatable.story.js +1 -3
- package/lib/cjs/select/stories/select-creatable.story.js.map +1 -1
- package/lib/cjs/select/stories/select-custom-label.story.js +1 -3
- package/lib/cjs/select/stories/select-custom-label.story.js.map +1 -1
- package/lib/cjs/select/stories/select-default.story.js +1 -3
- package/lib/cjs/select/stories/select-default.story.js.map +1 -1
- package/lib/cjs/select/stories/select-disabled.story.js +1 -3
- package/lib/cjs/select/stories/select-disabled.story.js.map +1 -1
- package/lib/cjs/select/stories/select-empty.story.js +1 -3
- package/lib/cjs/select/stories/select-empty.story.js.map +1 -1
- package/lib/cjs/select/stories/select-error-state.story.js +1 -3
- package/lib/cjs/select/stories/select-error-state.story.js.map +1 -1
- package/lib/cjs/select/stories/select-inside-dialog.story.js +1 -3
- package/lib/cjs/select/stories/select-inside-dialog.story.js.map +1 -1
- package/lib/cjs/select/stories/select-menu-positionings.story.js +1 -5
- package/lib/cjs/select/stories/select-menu-positionings.story.js.map +1 -1
- package/lib/cjs/select/stories/select-multi.story.js +1 -3
- package/lib/cjs/select/stories/select-multi.story.js.map +1 -1
- package/lib/cjs/select/stories/select-sizes.story.js +1 -5
- package/lib/cjs/select/stories/select-sizes.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-fixed-positioning.story.js +2 -9
- package/lib/cjs/spotlight/stories/spotlight-fixed-positioning.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-in-dialog.story.js +3 -9
- package/lib/cjs/spotlight/stories/spotlight-in-dialog.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-in-side-nav.story.js +2 -8
- package/lib/cjs/spotlight/stories/spotlight-in-side-nav.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-with-icon.story.js +2 -9
- package/lib/cjs/spotlight/stories/spotlight-with-icon.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-with-image.story.js +2 -9
- package/lib/cjs/spotlight/stories/spotlight-with-image.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-with-label.story.js +2 -9
- package/lib/cjs/spotlight/stories/spotlight-with-label.story.js.map +1 -1
- package/lib/cjs/spotlight/stories/spotlight-with-pointer.story.js +2 -9
- package/lib/cjs/spotlight/stories/spotlight-with-pointer.story.js.map +1 -1
- package/lib/cjs/timezone-picker/TimeZonePicker.js +6 -5
- package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
- package/lib/esm/data-grid/stories/datagrid-pinned-columns.stories.js +0 -1
- package/lib/esm/data-grid/stories/datagrid-pinned-columns.stories.js.map +1 -1
- package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js +0 -1
- package/lib/esm/data-grid/stories/datagrid-search-and-filters.stories.js.map +1 -1
- package/lib/esm/select/stories/select-async.story.js +1 -3
- package/lib/esm/select/stories/select-async.story.js.map +1 -1
- package/lib/esm/select/stories/select-clean.story.js +1 -3
- package/lib/esm/select/stories/select-clean.story.js.map +1 -1
- package/lib/esm/select/stories/select-controlled.story.js +1 -3
- package/lib/esm/select/stories/select-controlled.story.js.map +1 -1
- package/lib/esm/select/stories/select-creatable.story.js +1 -3
- package/lib/esm/select/stories/select-creatable.story.js.map +1 -1
- package/lib/esm/select/stories/select-custom-label.story.js +1 -3
- package/lib/esm/select/stories/select-custom-label.story.js.map +1 -1
- package/lib/esm/select/stories/select-default.story.js +1 -3
- package/lib/esm/select/stories/select-default.story.js.map +1 -1
- package/lib/esm/select/stories/select-disabled.story.js +1 -3
- package/lib/esm/select/stories/select-disabled.story.js.map +1 -1
- package/lib/esm/select/stories/select-empty.story.js +1 -3
- package/lib/esm/select/stories/select-empty.story.js.map +1 -1
- package/lib/esm/select/stories/select-error-state.story.js +1 -3
- package/lib/esm/select/stories/select-error-state.story.js.map +1 -1
- package/lib/esm/select/stories/select-inside-dialog.story.js +1 -3
- package/lib/esm/select/stories/select-inside-dialog.story.js.map +1 -1
- package/lib/esm/select/stories/select-menu-positionings.story.js +1 -5
- package/lib/esm/select/stories/select-menu-positionings.story.js.map +1 -1
- package/lib/esm/select/stories/select-multi.story.js +1 -3
- package/lib/esm/select/stories/select-multi.story.js.map +1 -1
- package/lib/esm/select/stories/select-sizes.story.js +1 -5
- package/lib/esm/select/stories/select-sizes.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-fixed-positioning.story.js +2 -9
- package/lib/esm/spotlight/stories/spotlight-fixed-positioning.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-in-dialog.story.js +4 -10
- package/lib/esm/spotlight/stories/spotlight-in-dialog.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-in-side-nav.story.js +3 -9
- package/lib/esm/spotlight/stories/spotlight-in-side-nav.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-with-icon.story.js +2 -9
- package/lib/esm/spotlight/stories/spotlight-with-icon.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-with-image.story.js +2 -9
- package/lib/esm/spotlight/stories/spotlight-with-image.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-with-label.story.js +2 -9
- package/lib/esm/spotlight/stories/spotlight-with-label.story.js.map +1 -1
- package/lib/esm/spotlight/stories/spotlight-with-pointer.story.js +2 -9
- package/lib/esm/spotlight/stories/spotlight-with-pointer.story.js.map +1 -1
- package/lib/esm/timezone-picker/TimeZonePicker.js +6 -5
- package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
- package/lib/types/data-grid/stories/datagrid-pinned-columns.stories.d.ts +0 -3
- package/lib/types/data-grid/stories/datagrid-pinned-columns.stories.d.ts.map +1 -1
- package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts +0 -3
- package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts.map +1 -1
- package/lib/types/select/stories/select-async.story.d.ts +1 -2
- package/lib/types/select/stories/select-async.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-clean.story.d.ts +1 -2
- package/lib/types/select/stories/select-clean.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-controlled.story.d.ts +2 -2
- package/lib/types/select/stories/select-controlled.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-creatable.story.d.ts +1 -2
- package/lib/types/select/stories/select-creatable.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-custom-label.story.d.ts +1 -2
- package/lib/types/select/stories/select-custom-label.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-default.story.d.ts +1 -2
- package/lib/types/select/stories/select-default.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-disabled.story.d.ts +1 -2
- package/lib/types/select/stories/select-disabled.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-empty.story.d.ts +1 -2
- package/lib/types/select/stories/select-empty.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-error-state.story.d.ts +1 -2
- package/lib/types/select/stories/select-error-state.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-inside-dialog.story.d.ts +1 -2
- package/lib/types/select/stories/select-inside-dialog.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-menu-positionings.story.d.ts +1 -2
- package/lib/types/select/stories/select-menu-positionings.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-multi.story.d.ts +1 -2
- package/lib/types/select/stories/select-multi.story.d.ts.map +1 -1
- package/lib/types/select/stories/select-sizes.story.d.ts +1 -2
- package/lib/types/select/stories/select-sizes.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-fixed-positioning.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-fixed-positioning.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-in-dialog.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-in-dialog.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-in-side-nav.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-in-side-nav.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-with-icon.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-with-icon.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-with-image.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-with-image.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-with-label.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-with-label.story.d.ts.map +1 -1
- package/lib/types/spotlight/stories/spotlight-with-pointer.story.d.ts +1 -3
- package/lib/types/spotlight/stories/spotlight-with-pointer.story.d.ts.map +1 -1
- package/lib/types/timezone-picker/TimeZonePicker.d.ts.map +1 -1
- package/package.json +1 -2
- package/skills/ndl-react/SKILL.md +2 -2
- package/skills/ndl-react/components/select.md +13 -30
- package/skills/ndl-react/components/spotlight.md +11 -75
|
@@ -29,16 +29,12 @@ const EXAMPLE_OPTIONS = [
|
|
|
29
29
|
{ label: 'Graph Databases', value: 'graph-database' },
|
|
30
30
|
{ isDisabled: true, label: 'Disabled database option', value: 'disabled' },
|
|
31
31
|
];
|
|
32
|
-
const Component = (
|
|
33
|
-
var _a, _b, _c;
|
|
32
|
+
const Component = () => {
|
|
34
33
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex gap-token-16", children: [(0, jsx_runtime_1.jsx)(react_1.Select, { label: "Small", type: "select", size: "small", selectProps: {
|
|
35
|
-
menuIsOpen: (_a = props.selectProps) === null || _a === void 0 ? void 0 : _a.menuIsOpen,
|
|
36
34
|
options: EXAMPLE_OPTIONS,
|
|
37
35
|
} }), (0, jsx_runtime_1.jsx)(react_1.Select, { label: "Medium", type: "select", size: "medium", selectProps: {
|
|
38
|
-
menuIsOpen: (_b = props.selectProps) === null || _b === void 0 ? void 0 : _b.menuIsOpen,
|
|
39
36
|
options: EXAMPLE_OPTIONS,
|
|
40
37
|
} }), (0, jsx_runtime_1.jsx)(react_1.Select, { label: "Large", type: "select", size: "large", selectProps: {
|
|
41
|
-
menuIsOpen: (_c = props.selectProps) === null || _c === void 0 ? void 0 : _c.menuIsOpen,
|
|
42
38
|
options: EXAMPLE_OPTIONS,
|
|
43
39
|
} })] }));
|
|
44
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-sizes.story.js","sourceRoot":"","sources":["../../../../src/select/stories/select-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA0C;AAE1C,MAAM,eAAe,GAAG;IACtB,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE;IACvC,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACrD,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,0BAA0B,EAAE,KAAK,EAAE,UAAU,EAAE;CAC3E,CAAC;AAEF,MAAM,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"select-sizes.story.js","sourceRoot":"","sources":["../../../../src/select/stories/select-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA0C;AAE1C,MAAM,eAAe,GAAG;IACtB,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE;IACvC,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACrD,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,0BAA0B,EAAE,KAAK,EAAE,UAAU,EAAE;CAC3E,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,mBAAmB,aAChC,uBAAC,cAAM,IACL,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,OAAO,EACZ,WAAW,EAAE;oBACX,OAAO,EAAE,eAAe;iBACzB,GACD,EACF,uBAAC,cAAM,IACL,KAAK,EAAC,QAAQ,EACd,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,WAAW,EAAE;oBACX,OAAO,EAAE,eAAe;iBACzB,GACD,EACF,uBAAC,cAAM,IACL,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,OAAO,EACZ,WAAW,EAAE;oBACX,OAAO,EAAE,eAAe;iBACzB,GACD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Select } from '@neo4j-ndl/react';\n\nconst EXAMPLE_OPTIONS = [\n { label: 'Neo4j', value: 'neo4j' },\n { label: 'Needle 🪡', value: 'needle' },\n { label: 'Graph Databases', value: 'graph-database' },\n { isDisabled: true, label: 'Disabled database option', value: 'disabled' },\n];\n\nconst Component = () => {\n return (\n <div className=\"flex gap-token-16\">\n <Select\n label=\"Small\"\n type=\"select\"\n size=\"small\"\n selectProps={{\n options: EXAMPLE_OPTIONS,\n }}\n />\n <Select\n label=\"Medium\"\n type=\"select\"\n size=\"medium\"\n selectProps={{\n options: EXAMPLE_OPTIONS,\n }}\n />\n <Select\n label=\"Large\"\n type=\"select\"\n size=\"large\"\n selectProps={{\n options: EXAMPLE_OPTIONS,\n }}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -23,18 +23,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
23
23
|
*/
|
|
24
24
|
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
25
|
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
-
const
|
|
27
|
-
const Component = (props) => {
|
|
26
|
+
const Component = () => {
|
|
28
27
|
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
29
28
|
const { setIsOpen, setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
30
29
|
const targetId = `test-target-${themeClassName}`;
|
|
31
|
-
(0,
|
|
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: "flex justify-center gap-token-64 h-[100px]", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)("div", { className: "left-[auto] top-[110px] fixed", children: (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, shouldRenderAsChild: true, indicatorVariant: "border", indicatorPlacement: "middle-middle", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => alert('Target button clicked'), children: "Target" }) }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-token-64 h-[100px]", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)("div", { className: "left-[auto] top-[110px] fixed", children: (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, shouldRenderAsChild: true, indicatorVariant: "border", indicatorPlacement: "middle-middle", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => alert('Target button clicked'), children: "Target" }) }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
38
31
|
setIsOpen(false);
|
|
39
32
|
setActiveSpotlight(null);
|
|
40
33
|
}, children: "Close" }), 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" })] })] }));
|
|
@@ -1 +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,4CAO0B;
|
|
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,4CAO0B;AAE1B,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,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,OAAO,CACL,iCAAK,SAAS,EAAC,4CAA4C,aACzD,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACf,gCAAK,SAAS,EAAC,+BAA+B,YAC5C,uBAAC,uBAAe,IACd,EAAE,EAAE,QAAQ,EACZ,mBAAmB,QACnB,gBAAgB,EAAC,QAAQ,EACzB,kBAAkB,EAAC,eAAe,YAElC,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,uBAE5C,GACC,GACd,EACN,wBAAC,iBAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,MAAM,EAAE,QAAQ,EAChB,OAAO,EACL,uBAAC,sBAAc,IACb,OAAO,EAAE,GAAG,EAAE;wBACZ,SAAS,CAAC,KAAK,CAAC,CAAC;wBACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;oBAC3B,CAAC,sBAGc,aAGnB,uBAAC,iBAAS,CAAC,MAAM,mCAAoC,EACrD,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IACtC,IACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n FilledButton,\n OutlinedButton,\n Spotlight,\n SpotlightTarget,\n useNeedleTheme,\n useSpotlightContext,\n} from '@neo4j-ndl/react';\n\nconst Component = () => {\n const { themeClassName } = useNeedleTheme();\n const { setIsOpen, setActiveSpotlight } = useSpotlightContext();\n\n const targetId = `test-target-${themeClassName}`;\n\n return (\n <div className=\"flex justify-center gap-token-64 h-[100px]\">\n <FilledButton onClick={() => setActiveSpotlight(targetId)}>\n Activate Spotlight\n </FilledButton>\n <div className=\"left-[auto] top-[110px] fixed\">\n <SpotlightTarget\n id={targetId}\n shouldRenderAsChild\n indicatorVariant=\"border\"\n indicatorPlacement=\"middle-middle\"\n >\n <FilledButton onClick={() => alert('Target button clicked')}>\n Target\n </FilledButton>\n </SpotlightTarget>\n </div>\n <Spotlight\n placement=\"bottom-end-top-end\"\n target={targetId}\n actions={\n <OutlinedButton\n onClick={() => {\n setIsOpen(false);\n setActiveSpotlight(null);\n }}\n >\n Close\n </OutlinedButton>\n }\n >\n <Spotlight.Header>This is a header</Spotlight.Header>\n <Spotlight.Body>This is content</Spotlight.Body>\n </Spotlight>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -24,18 +24,12 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
24
24
|
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
25
|
const react_1 = require("@neo4j-ndl/react");
|
|
26
26
|
const react_2 = require("react");
|
|
27
|
-
const Component = (
|
|
27
|
+
const Component = () => {
|
|
28
28
|
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
29
29
|
const { setIsOpen, setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
30
|
-
const [isModalOpen, setIsModalOpen] = (0, react_2.useState)(
|
|
30
|
+
const [isModalOpen, setIsModalOpen] = (0, react_2.useState)(false);
|
|
31
31
|
const targetId = `test-target-${themeClassName}`;
|
|
32
|
-
(0,
|
|
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: "flex justify-center gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsModalOpen(true), children: "Open Dialog" }), (0, jsx_runtime_1.jsxs)(react_1.Dialog, { isOpen: isModalOpen, onClose: () => setIsModalOpen(false), className: themeClassName, children: [(0, jsx_runtime_1.jsx)(react_1.Dialog.Header, { children: "Using Spotlight inside a dialog" }), (0, jsx_runtime_1.jsxs)(react_1.Dialog.Content, { className: "flex flex-col gap-token-32", children: [(0, jsx_runtime_1.jsxs)(react_1.Typography, { variant: "body-medium", children: ["Spotlight and SpotlightTarget should behave automatically correct when used inside a dialog. If positioning is not on top of everything, you might want to override the", (0, jsx_runtime_1.jsx)("code", { children: "--spotlight-z-index" }), " css variable."] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, shouldRenderAsChild: true, indicatorVariant: "border", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => alert('Target button clicked'), children: "Target" }) })] })] }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsModalOpen(true), children: "Open Dialog" }), (0, jsx_runtime_1.jsxs)(react_1.Dialog, { isOpen: isModalOpen, onClose: () => setIsModalOpen(false), className: themeClassName, children: [(0, jsx_runtime_1.jsx)(react_1.Dialog.Header, { children: "Using Spotlight inside a dialog" }), (0, jsx_runtime_1.jsxs)(react_1.Dialog.Content, { className: "flex flex-col gap-token-32", children: [(0, jsx_runtime_1.jsxs)(react_1.Typography, { variant: "body-medium", children: ["Spotlight and SpotlightTarget should behave automatically correct when used inside a dialog. If positioning is not on top of everything, you might want to override the", (0, jsx_runtime_1.jsx)("code", { children: "--spotlight-z-index" }), " css variable."] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, shouldRenderAsChild: true, indicatorVariant: "border", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => alert('Target button clicked'), children: "Target" }) })] })] }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
39
33
|
setIsOpen(false);
|
|
40
34
|
setActiveSpotlight(null);
|
|
41
35
|
}, children: "Close" }), 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" })] })] })] }));
|
|
@@ -1 +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,4CAS0B;AAC1B,
|
|
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,4CAS0B;AAC1B,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,sBAAc,GAAE,CAAC;IAC5C,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAEhE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,eAAe,cAAc,EAAE,CAAC;IAEjD,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,4BAElC,EACf,wBAAC,cAAM,IACL,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,EACpC,SAAS,EAAE,cAAc,aAEzB,uBAAC,cAAM,CAAC,MAAM,kDAAgD,EAC9D,wBAAC,cAAM,CAAC,OAAO,IAAC,SAAS,EAAC,4BAA4B,aACpD,wBAAC,kBAAU,IAAC,OAAO,EAAC,aAAa,wLAI/B,mEAAgC,sBACrB,EACb,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACf,uBAAC,uBAAe,IACd,EAAE,EAAE,QAAQ,EACZ,mBAAmB,QACnB,gBAAgB,EAAC,QAAQ,YAEzB,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,uBAE5C,GACC,IACd,IACS,EACjB,wBAAC,iBAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,MAAM,EAAE,QAAQ,EAChB,OAAO,EACL,uBAAC,sBAAc,IACb,OAAO,EAAE,GAAG,EAAE;gCACZ,SAAS,CAAC,KAAK,CAAC,CAAC;gCACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;4BAC3B,CAAC,sBAGc,aAGnB,uBAAC,iBAAS,CAAC,MAAM,mCAAoC,EACrD,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IACtC,IACL,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n Dialog,\n FilledButton,\n OutlinedButton,\n Spotlight,\n SpotlightTarget,\n Typography,\n useNeedleTheme,\n useSpotlightContext,\n} from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const { themeClassName } = useNeedleTheme();\n const { setIsOpen, setActiveSpotlight } = useSpotlightContext();\n\n const [isModalOpen, setIsModalOpen] = useState<boolean>(false);\n const targetId = `test-target-${themeClassName}`;\n\n return (\n <div className=\"flex justify-center gap-token-64\">\n <FilledButton onClick={() => setIsModalOpen(true)}>\n Open Dialog\n </FilledButton>\n <Dialog\n isOpen={isModalOpen}\n onClose={() => setIsModalOpen(false)}\n className={themeClassName}\n >\n <Dialog.Header>Using Spotlight inside a dialog</Dialog.Header>\n <Dialog.Content className=\"flex flex-col gap-token-32\">\n <Typography variant=\"body-medium\">\n Spotlight and SpotlightTarget should behave automatically correct\n when used inside a dialog. If positioning is not on top of\n everything, you might want to override the\n <code>--spotlight-z-index</code> css variable.\n </Typography>\n <div className=\"flex justify-center gap-token-64\">\n <FilledButton onClick={() => setActiveSpotlight(targetId)}>\n Activate Spotlight\n </FilledButton>\n <SpotlightTarget\n id={targetId}\n shouldRenderAsChild\n indicatorVariant=\"border\"\n >\n <FilledButton onClick={() => alert('Target button clicked')}>\n Target\n </FilledButton>\n </SpotlightTarget>\n </div>\n </Dialog.Content>\n <Spotlight\n placement=\"bottom-end-top-end\"\n target={targetId}\n actions={\n <OutlinedButton\n onClick={() => {\n setIsOpen(false);\n setActiveSpotlight(null);\n }}\n >\n Close\n </OutlinedButton>\n }\n >\n <Spotlight.Header>This is a header</Spotlight.Header>\n <Spotlight.Body>This is content</Spotlight.Body>\n </Spotlight>\n </Dialog>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -24,7 +24,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
24
24
|
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
25
|
const react_1 = require("@neo4j-ndl/react");
|
|
26
26
|
const react_2 = require("react");
|
|
27
|
-
const Component = (
|
|
27
|
+
const Component = () => {
|
|
28
28
|
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
29
29
|
const { setActiveSpotlight, setIsOpen } = (0, react_1.useSpotlightContext)();
|
|
30
30
|
const [isSelected, setIsSelected] = (0, react_2.useState)('aura-db-instances');
|
|
@@ -32,13 +32,7 @@ const Component = (props) => {
|
|
|
32
32
|
const handleClick = (item) => {
|
|
33
33
|
setIsSelected(item);
|
|
34
34
|
};
|
|
35
|
-
(0,
|
|
36
|
-
if (props.isChromatic) {
|
|
37
|
-
setActiveSpotlight(targetId);
|
|
38
|
-
setIsOpen(true);
|
|
39
|
-
}
|
|
40
|
-
}, [setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
41
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "h-[500px] flex", children: [(0, jsx_runtime_1.jsxs)(react_1.SideNavigation, { isExpanded: true, ariaLabel: "Main side navigation", children: [(0, jsx_runtime_1.jsx)(react_1.SideNavigation.CategoryHeader, { children: "AuraDB" }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.ListItem, { children: (0, jsx_runtime_1.jsx)(react_1.SideNavigation.NavItem, { onClick: () => handleClick('aura-db-instances'), isActive: isSelected === 'aura-db-instances', label: "Instances" }) }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.ListItem, { children: (0, jsx_runtime_1.jsx)(react_1.SideNavigation.NavItem, { onClick: () => handleClick('aura-db-connect'), isActive: isSelected === 'aura-db-connect', label: "Connect" }) }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.ListItem, { children: (0, jsx_runtime_1.jsx)(react_1.SideNavigation.NavItem, { onClick: () => handleClick('aura-db-python'), isActive: isSelected === 'aura-db-python', label: "Python" }) }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.ListItem, { children: (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, indicatorVariant: "point", indicatorPlacement: "top-right", shouldRenderAsChild: true, children: (0, jsx_runtime_1.jsx)(react_1.SideNavigation.NavItem, { onClick: () => handleClick('aura-db-javascript'), isActive: isSelected === 'aura-db-javascript', label: "JavaScript" }) }) }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.CategoryHeader, { children: "AuraDS" }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.ListItem, { children: (0, jsx_runtime_1.jsx)(react_1.SideNavigation.NavItem, { onClick: () => handleClick('aura-ds-instances'), isActive: isSelected === 'aura-ds-instances', label: "Instances" }) }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.ListItem, { children: (0, jsx_runtime_1.jsx)(react_1.SideNavigation.NavItem, { onClick: () => handleClick('aura-ds-getting-started'), isActive: isSelected === 'aura-ds-getting-started', label: "Getting Started" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full h-full flex flex-col items-center justify-center rounded-md p-token-16", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "top-end-top-start", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
35
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "h-[500px] flex", children: [(0, jsx_runtime_1.jsxs)(react_1.SideNavigation, { isExpanded: true, ariaLabel: "Main side navigation", children: [(0, jsx_runtime_1.jsx)(react_1.SideNavigation.CategoryHeader, { children: "AuraDB" }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.ListItem, { children: (0, jsx_runtime_1.jsx)(react_1.SideNavigation.NavItem, { onClick: () => handleClick('aura-db-instances'), isActive: isSelected === 'aura-db-instances', label: "Instances" }) }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.ListItem, { children: (0, jsx_runtime_1.jsx)(react_1.SideNavigation.NavItem, { onClick: () => handleClick('aura-db-connect'), isActive: isSelected === 'aura-db-connect', label: "Connect" }) }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.ListItem, { children: (0, jsx_runtime_1.jsx)(react_1.SideNavigation.NavItem, { onClick: () => handleClick('aura-db-python'), isActive: isSelected === 'aura-db-python', label: "Python" }) }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.ListItem, { children: (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, borderRadius: 4, indicatorVariant: "point", indicatorPlacement: "top-right", shouldRenderAsChild: true, children: (0, jsx_runtime_1.jsx)(react_1.SideNavigation.NavItem, { onClick: () => handleClick('aura-db-javascript'), isActive: isSelected === 'aura-db-javascript', label: "JavaScript" }) }) }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.CategoryHeader, { children: "AuraDS" }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.ListItem, { children: (0, jsx_runtime_1.jsx)(react_1.SideNavigation.NavItem, { onClick: () => handleClick('aura-ds-instances'), isActive: isSelected === 'aura-ds-instances', label: "Instances" }) }), (0, jsx_runtime_1.jsx)(react_1.SideNavigation.ListItem, { children: (0, jsx_runtime_1.jsx)(react_1.SideNavigation.NavItem, { onClick: () => handleClick('aura-ds-getting-started'), isActive: isSelected === 'aura-ds-getting-started', label: "Getting Started" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full h-full flex flex-col items-center justify-center rounded-md p-token-16", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "top-end-top-start", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
42
36
|
setIsOpen(false);
|
|
43
37
|
setActiveSpotlight(null);
|
|
44
38
|
}, children: "Close" }), 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" })] })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spotlight-in-side-nav.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-in-side-nav.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAQ0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"spotlight-in-side-nav.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-in-side-nav.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAQ0B;AAC1B,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,sBAAc,GAAE,CAAC;IAC5C,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAEhE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAC1C,mBAAmB,CACpB,CAAC;IACF,MAAM,QAAQ,GAAG,eAAe,cAAc,EAAE,CAAC;IAEjD,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,EAAE;QACnC,aAAa,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,CACL,iCAAK,SAAS,EAAC,gBAAgB,aAC7B,wBAAC,sBAAc,IAAC,UAAU,EAAE,IAAI,EAAE,SAAS,EAAC,sBAAsB,aAChE,uBAAC,sBAAc,CAAC,cAAc,yBAAuC,EACrE,uBAAC,sBAAc,CAAC,QAAQ,cACtB,uBAAC,sBAAc,CAAC,OAAO,IACrB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,mBAAmB,CAAC,EAC/C,QAAQ,EAAE,UAAU,KAAK,mBAAmB,EAC5C,KAAK,EAAC,WAAW,GACjB,GACsB,EAC1B,uBAAC,sBAAc,CAAC,QAAQ,cACtB,uBAAC,sBAAc,CAAC,OAAO,IACrB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAC7C,QAAQ,EAAE,UAAU,KAAK,iBAAiB,EAC1C,KAAK,EAAC,SAAS,GACf,GACsB,EAC1B,uBAAC,sBAAc,CAAC,QAAQ,cACtB,uBAAC,sBAAc,CAAC,OAAO,IACrB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAC5C,QAAQ,EAAE,UAAU,KAAK,gBAAgB,EACzC,KAAK,EAAC,QAAQ,GACd,GACsB,EAC1B,uBAAC,sBAAc,CAAC,QAAQ,cACtB,uBAAC,uBAAe,IACd,EAAE,EAAE,QAAQ,EACZ,YAAY,EAAE,CAAC,EACf,gBAAgB,EAAC,OAAO,EACxB,kBAAkB,EAAC,WAAW,EAC9B,mBAAmB,kBAEnB,uBAAC,sBAAc,CAAC,OAAO,IACrB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,oBAAoB,CAAC,EAChD,QAAQ,EAAE,UAAU,KAAK,oBAAoB,EAC7C,KAAK,EAAC,YAAY,GAClB,GACc,GACM,EAC1B,uBAAC,sBAAc,CAAC,cAAc,yBAAuC,EACrE,uBAAC,sBAAc,CAAC,QAAQ,cACtB,uBAAC,sBAAc,CAAC,OAAO,IACrB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,mBAAmB,CAAC,EAC/C,QAAQ,EAAE,UAAU,KAAK,mBAAmB,EAC5C,KAAK,EAAC,WAAW,GACjB,GACsB,EAC1B,uBAAC,sBAAc,CAAC,QAAQ,cACtB,uBAAC,sBAAc,CAAC,OAAO,IACrB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,yBAAyB,CAAC,EACrD,QAAQ,EAAE,UAAU,KAAK,yBAAyB,EAClD,KAAK,EAAC,iBAAiB,GACvB,GACsB,IACX,EACjB,gCAAK,SAAS,EAAC,+EAA+E,YAC5F,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,GACX,EACN,wBAAC,iBAAS,IACR,SAAS,EAAC,mBAAmB,EAC7B,MAAM,EAAE,QAAQ,EAChB,OAAO,EACL,uBAAC,sBAAc,IACb,OAAO,EAAE,GAAG,EAAE;wBACZ,SAAS,CAAC,KAAK,CAAC,CAAC;wBACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;oBAC3B,CAAC,sBAGc,aAGnB,uBAAC,iBAAS,CAAC,MAAM,mCAAoC,EACrD,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IACtC,IACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n FilledButton,\n OutlinedButton,\n SideNavigation,\n Spotlight,\n SpotlightTarget,\n useNeedleTheme,\n useSpotlightContext,\n} from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const { themeClassName } = useNeedleTheme();\n const { setActiveSpotlight, setIsOpen } = useSpotlightContext();\n\n const [isSelected, setIsSelected] = useState<string | null>(\n 'aura-db-instances',\n );\n const targetId = `test-target-${themeClassName}`;\n\n const handleClick = (item: string) => {\n setIsSelected(item);\n };\n\n return (\n <div className=\"h-[500px] flex\">\n <SideNavigation isExpanded={true} ariaLabel=\"Main side navigation\">\n <SideNavigation.CategoryHeader>AuraDB</SideNavigation.CategoryHeader>\n <SideNavigation.ListItem>\n <SideNavigation.NavItem\n onClick={() => handleClick('aura-db-instances')}\n isActive={isSelected === 'aura-db-instances'}\n label=\"Instances\"\n />\n </SideNavigation.ListItem>\n <SideNavigation.ListItem>\n <SideNavigation.NavItem\n onClick={() => handleClick('aura-db-connect')}\n isActive={isSelected === 'aura-db-connect'}\n label=\"Connect\"\n />\n </SideNavigation.ListItem>\n <SideNavigation.ListItem>\n <SideNavigation.NavItem\n onClick={() => handleClick('aura-db-python')}\n isActive={isSelected === 'aura-db-python'}\n label=\"Python\"\n />\n </SideNavigation.ListItem>\n <SideNavigation.ListItem>\n <SpotlightTarget\n id={targetId}\n borderRadius={4}\n indicatorVariant=\"point\"\n indicatorPlacement=\"top-right\"\n shouldRenderAsChild\n >\n <SideNavigation.NavItem\n onClick={() => handleClick('aura-db-javascript')}\n isActive={isSelected === 'aura-db-javascript'}\n label=\"JavaScript\"\n />\n </SpotlightTarget>\n </SideNavigation.ListItem>\n <SideNavigation.CategoryHeader>AuraDS</SideNavigation.CategoryHeader>\n <SideNavigation.ListItem>\n <SideNavigation.NavItem\n onClick={() => handleClick('aura-ds-instances')}\n isActive={isSelected === 'aura-ds-instances'}\n label=\"Instances\"\n />\n </SideNavigation.ListItem>\n <SideNavigation.ListItem>\n <SideNavigation.NavItem\n onClick={() => handleClick('aura-ds-getting-started')}\n isActive={isSelected === 'aura-ds-getting-started'}\n label=\"Getting Started\"\n />\n </SideNavigation.ListItem>\n </SideNavigation>\n <div className=\"w-full h-full flex flex-col items-center justify-center rounded-md p-token-16\">\n <FilledButton onClick={() => setActiveSpotlight(targetId)}>\n Activate Spotlight\n </FilledButton>\n </div>\n <Spotlight\n placement=\"top-end-top-start\"\n target={targetId}\n actions={\n <OutlinedButton\n onClick={() => {\n setIsOpen(false);\n setActiveSpotlight(null);\n }}\n >\n Close\n </OutlinedButton>\n }\n >\n <Spotlight.Header>This is a header</Spotlight.Header>\n <Spotlight.Body>This is content</Spotlight.Body>\n </Spotlight>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -24,18 +24,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
24
24
|
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
25
|
const react_1 = require("@neo4j-ndl/react");
|
|
26
26
|
const icons_1 = require("@neo4j-ndl/react/icons");
|
|
27
|
-
const
|
|
28
|
-
const Component = (props) => {
|
|
27
|
+
const Component = () => {
|
|
29
28
|
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
30
29
|
const { setIsOpen, setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
31
30
|
const targetId = `test-target-${themeClassName}`;
|
|
32
|
-
(0,
|
|
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: "flex justify-center gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, indicatorVariant: "border", shouldRenderAsChild: true, children: (0, jsx_runtime_1.jsx)(react_1.TextButton, { onClick: () => alert('Target button clicked'), children: "Target" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, indicatorVariant: "border", shouldRenderAsChild: true, children: (0, jsx_runtime_1.jsx)(react_1.TextButton, { onClick: () => alert('Target button clicked'), children: "Target" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
39
32
|
setIsOpen(false);
|
|
40
33
|
setActiveSpotlight(null);
|
|
41
34
|
}, children: "Close" }), 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" })] })] }));
|
|
@@ -1 +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,4CAQ0B;AAC1B,kDAAgE;
|
|
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,4CAQ0B;AAC1B,kDAAgE;AAEhE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,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,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACf,uBAAC,uBAAe,IACd,EAAE,EAAE,QAAQ,EACZ,gBAAgB,EAAC,QAAQ,EACzB,mBAAmB,kBAEnB,uBAAC,kBAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,uBAE5C,GACG,EAClB,wBAAC,iBAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,MAAM,EAAE,QAAQ,EAChB,OAAO,EACL,uBAAC,sBAAc,IACb,OAAO,EAAE,GAAG,EAAE;wBACZ,SAAS,CAAC,KAAK,CAAC,CAAC;wBACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;oBAC3B,CAAC,sBAGc,aAGnB,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","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n FilledButton,\n OutlinedButton,\n Spotlight,\n SpotlightTarget,\n TextButton,\n useNeedleTheme,\n useSpotlightContext,\n} from '@neo4j-ndl/react';\nimport { FingerPrintIconOutline } from '@neo4j-ndl/react/icons';\n\nconst Component = () => {\n const { themeClassName } = useNeedleTheme();\n const { setIsOpen, setActiveSpotlight } = useSpotlightContext();\n\n const targetId = `test-target-${themeClassName}`;\n\n return (\n <div className=\"flex justify-center gap-token-64\">\n <FilledButton onClick={() => setActiveSpotlight(targetId)}>\n Activate Spotlight\n </FilledButton>\n <SpotlightTarget\n id={targetId}\n indicatorVariant=\"border\"\n shouldRenderAsChild\n >\n <TextButton onClick={() => alert('Target button clicked')}>\n Target\n </TextButton>\n </SpotlightTarget>\n <Spotlight\n placement=\"bottom-end-top-end\"\n target={targetId}\n actions={\n <OutlinedButton\n onClick={() => {\n setIsOpen(false);\n setActiveSpotlight(null);\n }}\n >\n Close\n </OutlinedButton>\n }\n >\n <Spotlight.IconWrapper>\n <FingerPrintIconOutline />\n </Spotlight.IconWrapper>\n <Spotlight.Header>This is a header</Spotlight.Header>\n <Spotlight.Body>This is content</Spotlight.Body>\n </Spotlight>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -23,18 +23,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
23
23
|
*/
|
|
24
24
|
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
25
|
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
-
const
|
|
27
|
-
const Component = (props) => {
|
|
26
|
+
const Component = () => {
|
|
28
27
|
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
29
28
|
const { setIsOpen, setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
30
29
|
const targetId = `test-target-${themeClassName}`;
|
|
31
|
-
(0,
|
|
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: "flex justify-center gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, shouldRenderAsChild: true, children: (0, jsx_runtime_1.jsx)(react_1.TextButton, { onClick: () => alert('Target button clicked'), children: "Target" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, shouldRenderAsChild: true, children: (0, jsx_runtime_1.jsx)(react_1.TextButton, { onClick: () => alert('Target button clicked'), children: "Target" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
38
31
|
setIsOpen(false);
|
|
39
32
|
setActiveSpotlight(null);
|
|
40
33
|
}, children: "Close" }), 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" })] })] }));
|
|
@@ -1 +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,4CAQ0B;
|
|
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,4CAQ0B;AAE1B,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,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,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACf,uBAAC,uBAAe,IAAC,EAAE,EAAE,QAAQ,EAAE,mBAAmB,kBAChD,uBAAC,kBAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,uBAE5C,GACG,EAClB,wBAAC,iBAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,MAAM,EAAE,QAAQ,EAChB,OAAO,EACL,uBAAC,sBAAc,IACb,OAAO,EAAE,GAAG,EAAE;wBACZ,SAAS,CAAC,KAAK,CAAC,CAAC;wBACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;oBAC3B,CAAC,sBAGc,aAGnB,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","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n FilledButton,\n OutlinedButton,\n Spotlight,\n SpotlightTarget,\n TextButton,\n useNeedleTheme,\n useSpotlightContext,\n} from '@neo4j-ndl/react';\n\nconst Component = () => {\n const { themeClassName } = useNeedleTheme();\n const { setIsOpen, setActiveSpotlight } = useSpotlightContext();\n\n const targetId = `test-target-${themeClassName}`;\n\n return (\n <div className=\"flex justify-center gap-token-64\">\n <FilledButton onClick={() => setActiveSpotlight(targetId)}>\n Activate Spotlight\n </FilledButton>\n <SpotlightTarget id={targetId} shouldRenderAsChild>\n <TextButton onClick={() => alert('Target button clicked')}>\n Target\n </TextButton>\n </SpotlightTarget>\n <Spotlight\n placement=\"bottom-end-top-end\"\n target={targetId}\n actions={\n <OutlinedButton\n onClick={() => {\n setIsOpen(false);\n setActiveSpotlight(null);\n }}\n >\n Close\n </OutlinedButton>\n }\n >\n <Spotlight.Image\n src=\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjY2NjIi8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSIxNCIgZmlsbD0iIzMzMyIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkV4YW1wbGUgSW1hZ2U8L3RleHQ+PC9zdmc+\"\n alt=\"example image\"\n />\n <Spotlight.Header>This is a header</Spotlight.Header>\n <Spotlight.Body>This is content</Spotlight.Body>\n </Spotlight>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -23,18 +23,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
23
23
|
*/
|
|
24
24
|
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
25
|
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
-
const
|
|
27
|
-
const Component = (props) => {
|
|
26
|
+
const Component = () => {
|
|
28
27
|
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
29
28
|
const { setIsOpen, setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
30
29
|
const targetId = `test-target-${themeClassName}`;
|
|
31
|
-
(0,
|
|
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: "flex justify-center gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, indicatorVariant: "border", shouldRenderAsChild: true, children: (0, jsx_runtime_1.jsx)(react_1.TextButton, { onClick: () => alert('Target button clicked'), children: "Target" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, indicatorVariant: "border", shouldRenderAsChild: true, children: (0, jsx_runtime_1.jsx)(react_1.TextButton, { onClick: () => alert('Target button clicked'), children: "Target" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
38
31
|
setIsOpen(false);
|
|
39
32
|
setActiveSpotlight(null);
|
|
40
33
|
}, children: "Close" }), 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" })] })] }));
|
|
@@ -1 +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,4CAQ0B;
|
|
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,4CAQ0B;AAE1B,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,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,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACf,uBAAC,uBAAe,IACd,EAAE,EAAE,QAAQ,EACZ,gBAAgB,EAAC,QAAQ,EACzB,mBAAmB,kBAEnB,uBAAC,kBAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,uBAE5C,GACG,EAClB,wBAAC,iBAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,MAAM,EAAE,QAAQ,EAChB,OAAO,EACL,uBAAC,sBAAc,IACb,OAAO,EAAE,GAAG,EAAE;wBACZ,SAAS,CAAC,KAAK,CAAC,CAAC;wBACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;oBAC3B,CAAC,sBAGc,aAGnB,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","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n FilledButton,\n OutlinedButton,\n Spotlight,\n SpotlightTarget,\n TextButton,\n useNeedleTheme,\n useSpotlightContext,\n} from '@neo4j-ndl/react';\n\nconst Component = () => {\n const { themeClassName } = useNeedleTheme();\n const { setIsOpen, setActiveSpotlight } = useSpotlightContext();\n\n const targetId = `test-target-${themeClassName}`;\n\n return (\n <div className=\"flex justify-center gap-token-64\">\n <FilledButton onClick={() => setActiveSpotlight(targetId)}>\n Activate Spotlight\n </FilledButton>\n <SpotlightTarget\n id={targetId}\n indicatorVariant=\"border\"\n shouldRenderAsChild\n >\n <TextButton onClick={() => alert('Target button clicked')}>\n Target\n </TextButton>\n </SpotlightTarget>\n <Spotlight\n placement=\"bottom-end-top-end\"\n target={targetId}\n actions={\n <OutlinedButton\n onClick={() => {\n setIsOpen(false);\n setActiveSpotlight(null);\n }}\n >\n Close\n </OutlinedButton>\n }\n >\n <Spotlight.Label>NEW</Spotlight.Label>\n <Spotlight.Header>This is a header</Spotlight.Header>\n <Spotlight.Body>This is content</Spotlight.Body>\n </Spotlight>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -23,18 +23,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
23
23
|
*/
|
|
24
24
|
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
25
|
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
-
const
|
|
27
|
-
const Component = (props) => {
|
|
26
|
+
const Component = () => {
|
|
28
27
|
const { themeClassName } = (0, react_1.useNeedleTheme)();
|
|
29
28
|
const { setIsOpen, setActiveSpotlight } = (0, react_1.useSpotlightContext)();
|
|
30
29
|
const targetId = `test-target-${themeClassName}`;
|
|
31
|
-
(0,
|
|
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: "flex justify-center gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, shouldRenderAsChild: true, indicatorVariant: "point", indicatorPlacement: "top-right", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => alert('Target button clicked'), children: "Target" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-token-64", children: [(0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), (0, jsx_runtime_1.jsx)(react_1.SpotlightTarget, { id: targetId, shouldRenderAsChild: true, indicatorVariant: "point", indicatorPlacement: "top-right", children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => alert('Target button clicked'), children: "Target" }) }), (0, jsx_runtime_1.jsxs)(react_1.Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
38
31
|
setIsOpen(false);
|
|
39
32
|
setActiveSpotlight(null);
|
|
40
33
|
}, children: "Close" }), 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" })] })] }));
|
|
@@ -1 +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,4CAO0B;
|
|
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,4CAO0B;AAE1B,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,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,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACf,uBAAC,uBAAe,IACd,EAAE,EAAE,QAAQ,EACZ,mBAAmB,QACnB,gBAAgB,EAAC,OAAO,EACxB,kBAAkB,EAAC,WAAW,YAE9B,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,uBAE5C,GACC,EAClB,wBAAC,iBAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,MAAM,EAAE,QAAQ,EAChB,OAAO,EACL,uBAAC,sBAAc,IACb,OAAO,EAAE,GAAG,EAAE;wBACZ,SAAS,CAAC,KAAK,CAAC,CAAC;wBACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;oBAC3B,CAAC,sBAGc,aAGnB,uBAAC,iBAAS,CAAC,MAAM,mCAAoC,EACrD,uBAAC,iBAAS,CAAC,IAAI,kCAAiC,IACtC,IACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/*!\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n FilledButton,\n OutlinedButton,\n Spotlight,\n SpotlightTarget,\n useNeedleTheme,\n useSpotlightContext,\n} from '@neo4j-ndl/react';\n\nconst Component = () => {\n const { themeClassName } = useNeedleTheme();\n const { setIsOpen, setActiveSpotlight } = useSpotlightContext();\n\n const targetId = `test-target-${themeClassName}`;\n\n return (\n <div className=\"flex justify-center gap-token-64\">\n <FilledButton onClick={() => setActiveSpotlight(targetId)}>\n Activate Spotlight\n </FilledButton>\n <SpotlightTarget\n id={targetId}\n shouldRenderAsChild\n indicatorVariant=\"point\"\n indicatorPlacement=\"top-right\"\n >\n <FilledButton onClick={() => alert('Target button clicked')}>\n Target\n </FilledButton>\n </SpotlightTarget>\n <Spotlight\n placement=\"bottom-end-top-end\"\n target={targetId}\n actions={\n <OutlinedButton\n onClick={() => {\n setIsOpen(false);\n setActiveSpotlight(null);\n }}\n >\n Close\n </OutlinedButton>\n }\n >\n <Spotlight.Header>This is a header</Spotlight.Header>\n <Spotlight.Body>This is content</Spotlight.Body>\n </Spotlight>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -144,11 +144,9 @@ const TimeZonePicker = (_a) => {
|
|
|
144
144
|
}
|
|
145
145
|
else {
|
|
146
146
|
setTimeout(() => {
|
|
147
|
-
var _a
|
|
148
|
-
(_a =
|
|
149
|
-
const selectedIndex = (_b = filteredOptions.findIndex((opt) => opt.value === value)) !== null && _b !== void 0 ? _b : 0;
|
|
147
|
+
var _a;
|
|
148
|
+
const selectedIndex = (_a = filteredOptions.findIndex((opt) => opt.value === value)) !== null && _a !== void 0 ? _a : 0;
|
|
150
149
|
setFocusedIndex(selectedIndex >= 0 ? selectedIndex : 0);
|
|
151
|
-
setSearchQuery('');
|
|
152
150
|
}, 0);
|
|
153
151
|
}
|
|
154
152
|
}, [focusedIndex, isPopoverOpen, value, setFocusedIndex, filteredOptions]);
|
|
@@ -284,8 +282,11 @@ const TimeZonePicker = (_a) => {
|
|
|
284
282
|
if (((_a = event.relatedTarget) === null || _a === void 0 ? void 0 : _a.classList.contains('ndl-timezone-picker-popover-item')) === true) {
|
|
285
283
|
return;
|
|
286
284
|
}
|
|
287
|
-
// In UTC mode (utc or both), try to parse custom input on blur
|
|
285
|
+
// In UTC mode (utc or both), try to parse custom input on blur.
|
|
286
|
+
// An empty search query means nothing was typed since the last
|
|
287
|
+
// commit, e.g. the blur that follows selecting with Enter.
|
|
288
288
|
if ((mode === 'utc' || mode === 'both') &&
|
|
289
|
+
searchQuery !== '' &&
|
|
289
290
|
inputValue.trim().toUpperCase().startsWith('UTC')) {
|
|
290
291
|
const parsedOffset = (0, generate_timezone_options_1.parseCustomUTCOffset)(inputValue.trim());
|
|
291
292
|
if (parsedOffset) {
|