@neo4j-ndl/react 3.5.6 → 3.6.0

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.
Files changed (84) hide show
  1. package/lib/cjs/_common/IconIndicatorWrapper.js +43 -0
  2. package/lib/cjs/_common/IconIndicatorWrapper.js.map +1 -0
  3. package/lib/cjs/next/index.js +38 -0
  4. package/lib/cjs/next/index.js.map +1 -0
  5. package/lib/cjs/next/side-navigation/SideNavigation.js +206 -0
  6. package/lib/cjs/next/side-navigation/SideNavigation.js.map +1 -0
  7. package/lib/cjs/next/side-navigation/index.js +38 -0
  8. package/lib/cjs/next/side-navigation/index.js.map +1 -0
  9. package/lib/cjs/next/side-navigation/stories/index.js +43 -0
  10. package/lib/cjs/next/side-navigation/stories/index.js.map +1 -0
  11. package/lib/cjs/next/side-navigation/stories/side-nav-badges.story.js +74 -0
  12. package/lib/cjs/next/side-navigation/stories/side-nav-badges.story.js.map +1 -0
  13. package/lib/cjs/next/side-navigation/stories/side-nav-compact.story.js +56 -0
  14. package/lib/cjs/next/side-navigation/stories/side-nav-compact.story.js.map +1 -0
  15. package/lib/cjs/next/side-navigation/stories/side-nav-default.story.js +57 -0
  16. package/lib/cjs/next/side-navigation/stories/side-nav-default.story.js.map +1 -0
  17. package/lib/cjs/next/side-navigation/stories/side-nav-secondary.story.js +72 -0
  18. package/lib/cjs/next/side-navigation/stories/side-nav-secondary.story.js.map +1 -0
  19. package/lib/cjs/next/side-navigation/stories/side-nav.stories.js +87 -0
  20. package/lib/cjs/next/side-navigation/stories/side-nav.stories.js.map +1 -0
  21. package/lib/cjs/popover/Popover.js +2 -1
  22. package/lib/cjs/popover/Popover.js.map +1 -1
  23. package/lib/cjs/popover/use-popover.js +4 -2
  24. package/lib/cjs/popover/use-popover.js.map +1 -1
  25. package/lib/cjs/side-navigation/SideNavigation.js +4 -1
  26. package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
  27. package/lib/cjs/spotlight/Spotlight.js +2 -2
  28. package/lib/cjs/spotlight/Spotlight.js.map +1 -1
  29. package/lib/cjs/spotlight/SpotlightProvider.js +10 -10
  30. package/lib/cjs/spotlight/SpotlightProvider.js.map +1 -1
  31. package/lib/cjs/spotlight/SpotlightTarget.js +9 -8
  32. package/lib/cjs/spotlight/SpotlightTarget.js.map +1 -1
  33. package/lib/cjs/spotlight/use-indicator.js +20 -20
  34. package/lib/cjs/spotlight/use-indicator.js.map +1 -1
  35. package/lib/esm/_common/IconIndicatorWrapper.js +37 -0
  36. package/lib/esm/_common/IconIndicatorWrapper.js.map +1 -0
  37. package/lib/esm/next/index.js +22 -0
  38. package/lib/esm/next/index.js.map +1 -0
  39. package/lib/esm/next/side-navigation/SideNavigation.js +200 -0
  40. package/lib/esm/next/side-navigation/SideNavigation.js.map +1 -0
  41. package/lib/esm/next/side-navigation/index.js +22 -0
  42. package/lib/esm/next/side-navigation/index.js.map +1 -0
  43. package/lib/esm/next/side-navigation/stories/index.js +33 -0
  44. package/lib/esm/next/side-navigation/stories/index.js.map +1 -0
  45. package/lib/esm/next/side-navigation/stories/side-nav-badges.story.js +72 -0
  46. package/lib/esm/next/side-navigation/stories/side-nav-badges.story.js.map +1 -0
  47. package/lib/esm/next/side-navigation/stories/side-nav-compact.story.js +54 -0
  48. package/lib/esm/next/side-navigation/stories/side-nav-compact.story.js.map +1 -0
  49. package/lib/esm/next/side-navigation/stories/side-nav-default.story.js +55 -0
  50. package/lib/esm/next/side-navigation/stories/side-nav-default.story.js.map +1 -0
  51. package/lib/esm/next/side-navigation/stories/side-nav-secondary.story.js +70 -0
  52. package/lib/esm/next/side-navigation/stories/side-nav-secondary.story.js.map +1 -0
  53. package/lib/esm/next/side-navigation/stories/side-nav.stories.js +84 -0
  54. package/lib/esm/next/side-navigation/stories/side-nav.stories.js.map +1 -0
  55. package/lib/esm/popover/Popover.js +2 -1
  56. package/lib/esm/popover/Popover.js.map +1 -1
  57. package/lib/esm/popover/use-popover.js +4 -2
  58. package/lib/esm/popover/use-popover.js.map +1 -1
  59. package/lib/esm/side-navigation/SideNavigation.js +4 -1
  60. package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
  61. package/lib/esm/spotlight/Spotlight.js +2 -2
  62. package/lib/esm/spotlight/Spotlight.js.map +1 -1
  63. package/lib/esm/spotlight/SpotlightProvider.js +10 -10
  64. package/lib/esm/spotlight/SpotlightProvider.js.map +1 -1
  65. package/lib/esm/spotlight/SpotlightTarget.js +9 -8
  66. package/lib/esm/spotlight/SpotlightTarget.js.map +1 -1
  67. package/lib/esm/spotlight/use-indicator.js +20 -20
  68. package/lib/esm/spotlight/use-indicator.js.map +1 -1
  69. package/lib/types/_common/IconIndicatorWrapper.d.ts +31 -0
  70. package/lib/types/next/index.d.ts +21 -0
  71. package/lib/types/next/side-navigation/SideNavigation.d.ts +93 -0
  72. package/lib/types/next/side-navigation/index.d.ts +21 -0
  73. package/lib/types/next/side-navigation/stories/index.d.ts +28 -0
  74. package/lib/types/next/side-navigation/stories/side-nav-badges.story.d.ts +23 -0
  75. package/lib/types/next/side-navigation/stories/side-nav-compact.story.d.ts +23 -0
  76. package/lib/types/next/side-navigation/stories/side-nav-default.story.d.ts +23 -0
  77. package/lib/types/next/side-navigation/stories/side-nav-secondary.story.d.ts +23 -0
  78. package/lib/types/next/side-navigation/stories/side-nav.stories.d.ts +95 -0
  79. package/lib/types/popover/Popover.d.ts +3 -1
  80. package/lib/types/popover/use-popover.d.ts +2 -1
  81. package/lib/types/side-navigation/SideNavigation.d.ts +4 -1
  82. package/lib/types/spotlight/Spotlight.d.ts +6 -0
  83. package/lib/types/spotlight/SpotlightProvider.d.ts +3 -1
  84. package/package.json +7 -2
@@ -1 +1 @@
1
- {"version":3,"file":"use-indicator.js","sourceRoot":"","sources":["../../../src/spotlight/use-indicator.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,UAAU,EAEV,MAAM,EACN,WAAW,EACX,eAAe,EAEf,OAA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AAI;QACJ,gBAAgB;QAChB,SAAS;QACT,QAAQ;QACR,eAAe;KAChB,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import { type HtmlAttributes } from './types';
22
+ export type IconIndicatorType = 'info' | 'warning' | 'danger';
23
+ type IconIndicatorWrapperProps = {
24
+ children: React.ReactNode;
25
+ type: IconIndicatorType;
26
+ className?: string;
27
+ style?: React.CSSProperties;
28
+ htmlAttributes?: HtmlAttributes<'div'>;
29
+ };
30
+ export declare const IconIndicatorWrapper: import("react").ForwardRefExoticComponent<IconIndicatorWrapperProps & import("react").RefAttributes<HTMLDivElement>>;
31
+ export {};
@@ -0,0 +1,21 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export * from './side-navigation';
@@ -0,0 +1,93 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import type React from 'react';
22
+ import { type IconIndicatorType } from '../../_common/IconIndicatorWrapper';
23
+ import { type HtmlAttributes, type PolymorphicForwardRefExoticComponent } from '../../_common/types';
24
+ /**
25
+ * SideNav
26
+ */
27
+ type SideNavProps = {
28
+ children?: React.ReactNode;
29
+ className?: string;
30
+ style?: React.CSSProperties;
31
+ htmlAttributes?: HtmlAttributes<'nav'>;
32
+ isExpanded?: boolean;
33
+ shouldExpandOnHover?: boolean;
34
+ pinButtonCallback?: () => void;
35
+ expandedWidth?: React.CSSProperties['width'];
36
+ };
37
+ /**
38
+ * SideNavList
39
+ */
40
+ type SideNavListProps = {
41
+ children?: React.ReactNode;
42
+ className?: string;
43
+ style?: React.CSSProperties;
44
+ };
45
+ /**
46
+ * NavItem
47
+ */
48
+ type BaseItemProps = {
49
+ icon?: React.ReactNode;
50
+ label?: string;
51
+ isSelected?: boolean;
52
+ badge?: ItemBadgeProps;
53
+ };
54
+ type NavItemProps = BaseItemProps & {
55
+ rightElement?: React.ReactNode;
56
+ } & ({
57
+ as: 'button';
58
+ onClick?: HtmlAttributes<'button'>['onClick'];
59
+ } | {
60
+ as?: React.ElementType;
61
+ } | {
62
+ as: 'a';
63
+ href?: HtmlAttributes<'a'>['href'];
64
+ target?: HtmlAttributes<'a'>['target'];
65
+ });
66
+ /**
67
+ * CategoryHeader
68
+ */
69
+ type CategoryHeaderProps = {
70
+ children?: React.ReactNode;
71
+ className?: string;
72
+ };
73
+ /**
74
+ * ItemBadge
75
+ */
76
+ type ItemBadgeProps = {
77
+ number: number;
78
+ type: IconIndicatorType;
79
+ };
80
+ declare const SideNavigation: React.ForwardRefExoticComponent<SideNavProps & React.RefAttributes<HTMLDivElement>> & {
81
+ CategoryHeader: ({ children, className }: CategoryHeaderProps) => import("react/jsx-runtime").JSX.Element;
82
+ CategoryItem: React.ForwardRefExoticComponent<BaseItemProps & {
83
+ children?: React.ReactNode;
84
+ className?: string;
85
+ style?: React.CSSProperties;
86
+ htmlAttributes?: HtmlAttributes<"button">;
87
+ } & React.RefAttributes<HTMLButtonElement>>;
88
+ Divider: () => import("react/jsx-runtime").JSX.Element;
89
+ ItemBadge: ({ number, type }: ItemBadgeProps) => import("react/jsx-runtime").JSX.Element;
90
+ List: React.ForwardRefExoticComponent<SideNavListProps & React.RefAttributes<HTMLUListElement>>;
91
+ NavItem: PolymorphicForwardRefExoticComponent<"button", NavItemProps>;
92
+ };
93
+ export { SideNavigation };
@@ -0,0 +1,21 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export * from './SideNavigation';
@@ -0,0 +1,28 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export { default as SideNavDefault } from './side-nav-default.story';
22
+ export { default as SideNavCompact } from './side-nav-compact.story';
23
+ export { default as SideNavSecondary } from './side-nav-secondary.story';
24
+ export { default as SideNavBadges } from './side-nav-badges.story';
25
+ export declare const SideNavDefaultSrc: string;
26
+ export declare const SideNavCompactSrc: string;
27
+ export declare const SideNavSecondarySrc: string;
28
+ export declare const SideNavBadgesSrc: string;
@@ -0,0 +1,23 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
22
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
23
+ export default Component;
@@ -0,0 +1,23 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
22
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
23
+ export default Component;
@@ -0,0 +1,23 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
22
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
23
+ export default Component;
@@ -0,0 +1,23 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
22
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
23
+ export default Component;
@@ -0,0 +1,95 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ import { type StoryObj } from '@storybook/react';
22
+ declare const componentMeta: {
23
+ component: import("react").ForwardRefExoticComponent<{
24
+ children?: React.ReactNode;
25
+ className?: string;
26
+ style?: React.CSSProperties;
27
+ htmlAttributes?: import("../../../_common/types").HtmlAttributes<"nav">;
28
+ isExpanded?: boolean;
29
+ shouldExpandOnHover?: boolean;
30
+ pinButtonCallback?: () => void;
31
+ expandedWidth?: React.CSSProperties["width"];
32
+ } & import("react").RefAttributes<HTMLDivElement>> & {
33
+ CategoryHeader: ({ children, className }: {
34
+ children?: React.ReactNode;
35
+ className?: string;
36
+ }) => import("react/jsx-runtime").JSX.Element;
37
+ CategoryItem: import("react").ForwardRefExoticComponent<{
38
+ icon?: React.ReactNode;
39
+ label?: string;
40
+ isSelected?: boolean;
41
+ badge?: {
42
+ number: number;
43
+ type: import("../../../_common/IconIndicatorWrapper").IconIndicatorType;
44
+ };
45
+ } & {
46
+ children?: React.ReactNode;
47
+ className?: string;
48
+ style?: React.CSSProperties;
49
+ htmlAttributes?: import("../../../_common/types").HtmlAttributes<"button">;
50
+ } & import("react").RefAttributes<HTMLButtonElement>>;
51
+ Divider: () => import("react/jsx-runtime").JSX.Element;
52
+ ItemBadge: ({ number, type }: {
53
+ number: number;
54
+ type: import("../../../_common/IconIndicatorWrapper").IconIndicatorType;
55
+ }) => import("react/jsx-runtime").JSX.Element;
56
+ List: import("react").ForwardRefExoticComponent<{
57
+ children?: React.ReactNode;
58
+ className?: string;
59
+ style?: React.CSSProperties;
60
+ } & import("react").RefAttributes<HTMLUListElement>>;
61
+ NavItem: import("../../../_common/types").PolymorphicForwardRefExoticComponent<"button", {
62
+ icon?: React.ReactNode;
63
+ label?: string;
64
+ isSelected?: boolean;
65
+ badge?: {
66
+ number: number;
67
+ type: import("../../../_common/IconIndicatorWrapper").IconIndicatorType;
68
+ };
69
+ } & ({
70
+ rightElement?: React.ReactNode;
71
+ } & ({
72
+ as: "button";
73
+ onClick?: import("../../../_common/types").HtmlAttributes<"button">["onClick"];
74
+ } | {
75
+ as?: React.ElementType;
76
+ } | {
77
+ as: "a";
78
+ href?: import("../../../_common/types").HtmlAttributes<"a">["href"];
79
+ target?: import("../../../_common/types").HtmlAttributes<"a">["target"];
80
+ }))>;
81
+ };
82
+ parameters: {
83
+ controls: {
84
+ disable: boolean;
85
+ };
86
+ };
87
+ tags: string[];
88
+ title: string;
89
+ };
90
+ export default componentMeta;
91
+ type Story = StoryObj<typeof componentMeta>;
92
+ export declare const Default: Story;
93
+ export declare const Compact: Story;
94
+ export declare const WithSecondaryNav: Story;
95
+ export declare const WithBadges: Story;
@@ -48,10 +48,12 @@ export interface PopoverProps {
48
48
  initialFocus?: number | React.MutableRefObject<HTMLElement | null>;
49
49
  /** The role of the popover */
50
50
  role?: 'tooltip' | 'dialog' | 'alertdialog' | 'menu' | 'listbox' | 'grid' | 'tree';
51
+ /** If the popover should close when the user clicks outside of it */
52
+ closeOnClickOutside?: boolean;
51
53
  }
52
54
  export declare const usePopoverContext: () => import("./use-popover").UsePopoverReturn;
53
55
  export declare const Popover: {
54
- ({ children, anchorElement, placement, isOpen, offset, anchorPosition, hasAnchorPortal, shouldCaptureFocus, initialFocus, onOpenChange, role, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
56
+ ({ children, anchorElement, placement, isOpen, offset, anchorPosition, hasAnchorPortal, shouldCaptureFocus, initialFocus, onOpenChange, role, closeOnClickOutside, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
55
57
  Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLElement>>;
56
58
  Content: PolymorphicForwardRefExoticComponent<"div", PopoverContentProps>;
57
59
  };
@@ -34,6 +34,7 @@ export interface PopoverOptions {
34
34
  shouldCaptureFocus?: boolean;
35
35
  initialFocus?: number | React.MutableRefObject<HTMLElement | null>;
36
36
  role?: 'tooltip' | 'dialog' | 'alertdialog' | 'menu' | 'listbox' | 'grid' | 'tree';
37
+ closeOnClickOutside?: boolean;
37
38
  }
38
39
  export interface UsePopoverReturn extends UseInteractionsReturn, ReturnType<typeof useFloating> {
39
40
  isOpen: boolean;
@@ -47,4 +48,4 @@ export interface UsePopoverReturn extends UseInteractionsReturn, ReturnType<type
47
48
  shouldCaptureFocus: boolean | undefined;
48
49
  initialFocus: number | React.MutableRefObject<HTMLElement | null> | undefined;
49
50
  }
50
- export declare function usePopover({ isInitialOpen, placement, isOpen: controlledOpen, onOpenChange: setControlledOpen, offsetOption, anchorElement, anchorPosition, anchorElementAsPortalAnchor, shouldCaptureFocus, initialFocus, role: roleProp, }?: PopoverOptions): UsePopoverReturn;
51
+ export declare function usePopover({ isInitialOpen, placement, isOpen: controlledOpen, onOpenChange: setControlledOpen, offsetOption, anchorElement, anchorPosition, anchorElementAsPortalAnchor, shouldCaptureFocus, initialFocus, role: roleProp, closeOnClickOutside, }?: PopoverOptions): UsePopoverReturn;
@@ -71,10 +71,13 @@ export type SideNavigationGroupHeaderProps = {
71
71
  className?: string;
72
72
  style?: React.CSSProperties;
73
73
  };
74
+ /**
75
+ * @deprecated Use new SideNavigation from @neo4j-ndl/react/next instead.
76
+ */
74
77
  declare const SideNavigation: React.ForwardRefExoticComponent<SideNavigationProps & React.RefAttributes<HTMLDivElement>> & {
75
- List: React.ForwardRefExoticComponent<SideNavigationListProps & React.RefAttributes<HTMLUListElement>>;
76
78
  GroupHeader: PolymorphicForwardRefExoticComponent<"li", SideNavigationGroupHeaderProps>;
77
79
  Item: PolymorphicForwardRefExoticComponent<"a", SideNavigationItemProps>;
78
80
  ItemBadge: React.ForwardRefExoticComponent<SideNavigationItemBadgeProps & React.RefAttributes<HTMLSpanElement>>;
81
+ List: React.ForwardRefExoticComponent<SideNavigationListProps & React.RefAttributes<HTMLUListElement>>;
79
82
  };
80
83
  export { SideNavigation };
@@ -71,6 +71,8 @@ export type SpotlightProps = {
71
71
  className?: string;
72
72
  style?: React.CSSProperties;
73
73
  htmlAttributes?: HtmlAttributes<'div'>;
74
+ /** If the spotlight should close when the user clicks outside of it */
75
+ closeOnClickOutside?: boolean;
74
76
  } & Pick<PopoverProps, 'placement' | 'initialFocus'>;
75
77
  declare const Spotlight: Omit<React.ForwardRefExoticComponent<{
76
78
  /** Id of the SpotlightTarget where the spotlight should be rendered */
@@ -87,6 +89,8 @@ declare const Spotlight: Omit<React.ForwardRefExoticComponent<{
87
89
  className?: string;
88
90
  style?: React.CSSProperties;
89
91
  htmlAttributes?: HtmlAttributes<"div">;
92
+ /** If the spotlight should close when the user clicks outside of it */
93
+ closeOnClickOutside?: boolean;
90
94
  } & Pick<PopoverProps, "placement" | "initialFocus"> & {
91
95
  [key: string]: unknown;
92
96
  }>, "$$typeof"> & Omit<React.ExoticComponent<{
@@ -104,6 +108,8 @@ declare const Spotlight: Omit<React.ForwardRefExoticComponent<{
104
108
  className?: string;
105
109
  style?: React.CSSProperties;
106
110
  htmlAttributes?: HtmlAttributes<"div">;
111
+ /** If the spotlight should close when the user clicks outside of it */
112
+ closeOnClickOutside?: boolean;
107
113
  } & Pick<PopoverProps, "placement" | "initialFocus"> & {
108
114
  [key: string]: unknown;
109
115
  }>, never> & (<InstanceT extends React.ElementType = "div">(props: PolymorphicPropsWithRef<InstanceT, SpotlightProps>) => React.ReactElement | null) & {
@@ -38,6 +38,8 @@ type SpotlightProviderProps = {
38
38
  children: React.ReactNode;
39
39
  /** If the spotlights should have an overlay */
40
40
  hasOverlay?: boolean;
41
+ /** If the overlay should be transparent */
42
+ isOverlayTransparent?: boolean;
41
43
  };
42
- export declare const SpotlightProvider: (props: SpotlightProviderProps) => import("react/jsx-runtime").JSX.Element;
44
+ export declare const SpotlightProvider: ({ children, hasOverlay, isOverlayTransparent, }: SpotlightProviderProps) => import("react/jsx-runtime").JSX.Element;
43
45
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-ndl/react",
3
- "version": "3.5.6",
3
+ "version": "3.6.0",
4
4
  "sideEffects": false,
5
5
  "description": "React implementation of Neo4j Design System",
6
6
  "keywords": [
@@ -17,6 +17,11 @@
17
17
  "module": "./lib/esm/index.js",
18
18
  "types": "./lib/types/index.d.ts",
19
19
  "exports": {
20
+ "./next": {
21
+ "types": "./lib/types/next/index.d.ts",
22
+ "require": "./lib/cjs/next/index.js",
23
+ "import": "./lib/esm/next/index.js"
24
+ },
20
25
  "./icons": {
21
26
  "types": "./lib/types/icons/index.d.ts",
22
27
  "require": "./lib/cjs/icons/index.js",
@@ -65,7 +70,7 @@
65
70
  "@tanstack/react-table": "8.20.5",
66
71
  "react": ">=16.8.0",
67
72
  "react-dom": ">=16.8.0",
68
- "@neo4j-ndl/base": "^3.4.3"
73
+ "@neo4j-ndl/base": "^3.5.0"
69
74
  },
70
75
  "dependencies": {
71
76
  "@dnd-kit/core": "6.1.0",