@neo4j-ndl/react 4.9.36 → 4.9.38
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/segmented-control/SegmentedControl.js +1 -1
- package/lib/cjs/segmented-control/SegmentedControl.js.map +1 -1
- package/lib/esm/segmented-control/SegmentedControl.js +1 -1
- package/lib/esm/segmented-control/SegmentedControl.js.map +1 -1
- package/lib/types/segmented-control/SegmentedControl.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -105,7 +105,7 @@ const SegmentedControlItem = (_a) => {
|
|
|
105
105
|
'ndl-segment-item': !hasOnlyIcons,
|
|
106
106
|
});
|
|
107
107
|
const Component = as !== null && as !== void 0 ? as : 'button';
|
|
108
|
-
return ((0, jsx_runtime_1.jsxs)(Tooltip_1.Tooltip, Object.assign({ isPortaled: false, isDisabled: Boolean(description) === false }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.root, { type: "simple", children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip.Trigger, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.trigger, { hasButtonWrapper: true, children: (0, jsx_runtime_1.jsx)(Component, Object.assign({ onClick: () => !isSelected && onChange(value), className: baseClasses, style: style, ref: ref, "aria-label": description, disabled: isDisabled }, restProps, htmlAttributes, { children: children })) })), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip.Content, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content, { children: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip.Body, { children: description }) }))] })));
|
|
108
|
+
return ((0, jsx_runtime_1.jsxs)(Tooltip_1.Tooltip, Object.assign({ isPortaled: false, isDisabled: Boolean(description) === false }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.root, { type: "simple", children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip.Trigger, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.trigger, { hasButtonWrapper: true, children: (0, jsx_runtime_1.jsx)(Component, Object.assign({ "aria-pressed": isSelected, onClick: () => !isSelected && onChange(value), className: baseClasses, style: style, ref: ref, "aria-label": description, disabled: isDisabled }, restProps, htmlAttributes, { children: children })) })), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip.Content, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content, { children: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip.Body, { children: description }) }))] })));
|
|
109
109
|
};
|
|
110
110
|
SegmentedControlItem.displayName = 'SegmentedControl.Item';
|
|
111
111
|
const SegmentedControl = Object.assign(SegmentedControlComponent, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.js","sourceRoot":"","sources":["../../../src/segmented-control/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AACpC,+CAA0C;AAM1C,gDAA6C;AAyB7C,wCAAwC;AACxC,MAAM,uBAAuB;AAC3B,8DAA8D;AAC9D,eAAK,CAAC,aAAa,CAAsC,IAAI,CAAC,CAAC;AAEjE,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,uBAAuB,CAAC,CAAC;IAEpD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAGhC,EAaoD,EAAE,EAAE;QAbxD,EACA,IAAI,GAAG,QAAQ,EACf,YAAY,GAAG,KAAK,EACpB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,SAAS,EACT,KAAK,EACL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AAF,EAAE,GAAI,QAAQ,CAAC;IAEpD,OAAO,CACL,wBAAC,iBAAO,kBACN,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,KAAK,IACtC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,IACtB,IAAI,EAAC,QAAQ,aAEb,uBAAC,iBAAO,CAAC,OAAO,oBAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,IAAE,gBAAgB,kBAC1D,uBAAC,SAAS,kCACM,UAAU,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU,IAAI,QAAQ,CAAC,KAAK,CAAC,EAC7C,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,gBACI,WAAW,EACvB,QAAQ,EAAE,UAAU,IAChB,SAAS,EACT,cAAc,cAEjB,QAAQ,IACC,IACI,EAClB,uBAAC,iBAAO,CAAC,OAAO,oBAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,cACxC,uBAAC,iBAAO,CAAC,IAAI,cAAE,WAAW,GAAgB,IAC1B,KACV,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,oBAAoB,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAE3D,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,yBAAyB,EAAE;IAChE,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAC;AAEM,4CAAgB","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 */\nimport classNames from 'classnames';\nimport React, { useContext } from 'react';\n\nimport {\n type PolymorphicCommonProps,\n type TooltipObjectProps,\n} from '../_common/types';\nimport { Tooltip } from '../tooltip/Tooltip';\n\ntype SegmentedControlID = string | number;\n\ntype SegmentedControlProps<T extends SegmentedControlID> = {\n /** Additional class name */\n className?: string;\n /** Size of the segmented control */\n size?: 'small' | 'medium' | 'large';\n /** If segmented control items will include only icons (makes controls rectangular) */\n hasOnlyIcons?: boolean;\n /** The callback function triggered when the segmented control value changes */\n onChange: (e: T) => void | ((e: React.SetStateAction<T>) => void);\n /** The currently selected option */\n selected: T;\n /** The children component of the segmented control */\n children: React.ReactNode;\n /** Whether the segmented control has a box shadow applied */\n isFloating?: boolean;\n};\n\ntype SegmentedControlContext<T extends SegmentedControlID> = Required<\n Pick<SegmentedControlProps<T>, 'onChange' | 'selected' | 'hasOnlyIcons'>\n>;\n\n// eslint-disable-next-line no-redeclare\nconst SegmentedControlContext =\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n React.createContext<SegmentedControlContext<any> | null>(null);\n\nconst useSelectorContext = () => {\n const context = useContext(SegmentedControlContext);\n\n if (context === null) {\n throw new Error('SegmentedControl used without context');\n }\n\n return context;\n};\n\nconst SegmentedControlComponent = <\n T extends SegmentedControlID,\n U extends React.ElementType = 'div',\n>({\n size = 'medium',\n hasOnlyIcons = false,\n children,\n selected,\n onChange,\n as,\n className,\n style,\n isFloating = false,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<U, SegmentedControlProps<T>>) => {\n const classes = classNames('ndl-segmented-control', className, {\n 'ndl-floating': isFloating,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n });\n\n const Component = as ?? 'div';\n\n return (\n <Component\n className={classes}\n style={style}\n role=\"group\"\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <SegmentedControlContext.Provider\n value={{ hasOnlyIcons, onChange, selected }}\n >\n {children}\n </SegmentedControlContext.Provider>\n </Component>\n );\n};\n\nSegmentedControlComponent.displayName = 'SegmentedControl';\n\ntype SegmentedControlItemProps = {\n /** Additional class name */\n className?: string;\n /** The children component of the segmented control item */\n children?: React.ReactNode;\n /** The value of the segmented control item */\n value: string;\n /** The description of the segmented control item, will be displayed in the tooltip */\n description?: string;\n /** The tooltip props that will be applied if tooltip is set */\n tooltipProps?: TooltipObjectProps;\n /** Whether the segmented control item is disabled */\n isDisabled?: boolean;\n};\n\nconst SegmentedControlItem = <T extends React.ElementType = 'button'>({\n as,\n children,\n className,\n style,\n value,\n htmlAttributes,\n description,\n tooltipProps,\n isDisabled = false,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, SegmentedControlItemProps>) => {\n const { onChange, selected, hasOnlyIcons } = useSelectorContext();\n\n const isSelected = value === selected;\n\n const baseClasses = classNames(className, {\n 'ndl-current': isSelected,\n 'ndl-segment-icon': hasOnlyIcons,\n 'ndl-segment-item': !hasOnlyIcons,\n });\n\n const Component: React.ElementType = as ?? 'button';\n\n return (\n <Tooltip\n isPortaled={false}\n isDisabled={Boolean(description) === false}\n {...tooltipProps?.root}\n type=\"simple\"\n >\n <Tooltip.Trigger {...tooltipProps?.trigger} hasButtonWrapper>\n <Component\n aria-pressed={isSelected}\n onClick={() => !isSelected && onChange(value)}\n className={baseClasses}\n style={style}\n ref={ref}\n aria-label={description}\n disabled={isDisabled}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n <Tooltip.Body>{description}</Tooltip.Body>\n </Tooltip.Content>\n </Tooltip>\n );\n};\n\nSegmentedControlItem.displayName = 'SegmentedControl.Item';\n\nconst SegmentedControl = Object.assign(SegmentedControlComponent, {\n Item: SegmentedControlItem,\n});\n\nexport { SegmentedControl };\n"]}
|
|
@@ -66,7 +66,7 @@ const SegmentedControlItem = (_a) => {
|
|
|
66
66
|
'ndl-segment-item': !hasOnlyIcons,
|
|
67
67
|
});
|
|
68
68
|
const Component = as !== null && as !== void 0 ? as : 'button';
|
|
69
|
-
return (_jsxs(Tooltip, Object.assign({ isPortaled: false, isDisabled: Boolean(description) === false }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.root, { type: "simple", children: [_jsx(Tooltip.Trigger, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.trigger, { hasButtonWrapper: true, children: _jsx(Component, Object.assign({ onClick: () => !isSelected && onChange(value), className: baseClasses, style: style, ref: ref, "aria-label": description, disabled: isDisabled }, restProps, htmlAttributes, { children: children })) })), _jsx(Tooltip.Content, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content, { children: _jsx(Tooltip.Body, { children: description }) }))] })));
|
|
69
|
+
return (_jsxs(Tooltip, Object.assign({ isPortaled: false, isDisabled: Boolean(description) === false }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.root, { type: "simple", children: [_jsx(Tooltip.Trigger, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.trigger, { hasButtonWrapper: true, children: _jsx(Component, Object.assign({ "aria-pressed": isSelected, onClick: () => !isSelected && onChange(value), className: baseClasses, style: style, ref: ref, "aria-label": description, disabled: isDisabled }, restProps, htmlAttributes, { children: children })) })), _jsx(Tooltip.Content, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content, { children: _jsx(Tooltip.Body, { children: description }) }))] })));
|
|
70
70
|
};
|
|
71
71
|
SegmentedControlItem.displayName = 'SegmentedControl.Item';
|
|
72
72
|
const SegmentedControl = Object.assign(SegmentedControlComponent, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.js","sourceRoot":"","sources":["../../../src/segmented-control/SegmentedControl.tsx"],"names":[],"mappings":";;;;;;;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AAW,EACvB,QAAQ,EAAE,UAAU,IAChB,SAAS,EACT,cAAc,cAEjB,QAAQ,IACC,IACI,EAClB,KAAC,OAAO,CAAC,OAAO,oBAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,cACxC,KAAC,OAAO,CAAC,IAAI,cAAE,WAAW,GAAgB,IAC1B,KACV,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,oBAAoB,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAE3D,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,yBAAyB,EAAE;IAChE,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAC;AAEH,OAAO,EAAE,gBAAgB,EAAE,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 */\nimport classNames from 'classnames';\nimport React, { useContext } from 'react';\n\nimport {\n type PolymorphicCommonProps,\n type TooltipObjectProps,\n} from '../_common/types';\nimport { Tooltip } from '../tooltip/Tooltip';\n\ntype SegmentedControlID = string | number;\n\ntype SegmentedControlProps<T extends SegmentedControlID> = {\n /** Additional class name */\n className?: string;\n /** Size of the segmented control */\n size?: 'small' | 'medium' | 'large';\n /** If segmented control items will include only icons (makes controls rectangular) */\n hasOnlyIcons?: boolean;\n /** The callback function triggered when the segmented control value changes */\n onChange: (e: T) => void | ((e: React.SetStateAction<T>) => void);\n /** The currently selected option */\n selected: T;\n /** The children component of the segmented control */\n children: React.ReactNode;\n /** Whether the segmented control has a box shadow applied */\n isFloating?: boolean;\n};\n\ntype SegmentedControlContext<T extends SegmentedControlID> = Required<\n Pick<SegmentedControlProps<T>, 'onChange' | 'selected' | 'hasOnlyIcons'>\n>;\n\n// eslint-disable-next-line no-redeclare\nconst SegmentedControlContext =\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n React.createContext<SegmentedControlContext<any> | null>(null);\n\nconst useSelectorContext = () => {\n const context = useContext(SegmentedControlContext);\n\n if (context === null) {\n throw new Error('SegmentedControl used without context');\n }\n\n return context;\n};\n\nconst SegmentedControlComponent = <\n T extends SegmentedControlID,\n U extends React.ElementType = 'div',\n>({\n size = 'medium',\n hasOnlyIcons = false,\n children,\n selected,\n onChange,\n as,\n className,\n style,\n isFloating = false,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<U, SegmentedControlProps<T>>) => {\n const classes = classNames('ndl-segmented-control', className, {\n 'ndl-floating': isFloating,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n });\n\n const Component = as ?? 'div';\n\n return (\n <Component\n className={classes}\n style={style}\n role=\"group\"\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n <SegmentedControlContext.Provider\n value={{ hasOnlyIcons, onChange, selected }}\n >\n {children}\n </SegmentedControlContext.Provider>\n </Component>\n );\n};\n\nSegmentedControlComponent.displayName = 'SegmentedControl';\n\ntype SegmentedControlItemProps = {\n /** Additional class name */\n className?: string;\n /** The children component of the segmented control item */\n children?: React.ReactNode;\n /** The value of the segmented control item */\n value: string;\n /** The description of the segmented control item, will be displayed in the tooltip */\n description?: string;\n /** The tooltip props that will be applied if tooltip is set */\n tooltipProps?: TooltipObjectProps;\n /** Whether the segmented control item is disabled */\n isDisabled?: boolean;\n};\n\nconst SegmentedControlItem = <T extends React.ElementType = 'button'>({\n as,\n children,\n className,\n style,\n value,\n htmlAttributes,\n description,\n tooltipProps,\n isDisabled = false,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, SegmentedControlItemProps>) => {\n const { onChange, selected, hasOnlyIcons } = useSelectorContext();\n\n const isSelected = value === selected;\n\n const baseClasses = classNames(className, {\n 'ndl-current': isSelected,\n 'ndl-segment-icon': hasOnlyIcons,\n 'ndl-segment-item': !hasOnlyIcons,\n });\n\n const Component: React.ElementType = as ?? 'button';\n\n return (\n <Tooltip\n isPortaled={false}\n isDisabled={Boolean(description) === false}\n {...tooltipProps?.root}\n type=\"simple\"\n >\n <Tooltip.Trigger {...tooltipProps?.trigger} hasButtonWrapper>\n <Component\n aria-pressed={isSelected}\n onClick={() => !isSelected && onChange(value)}\n className={baseClasses}\n style={style}\n ref={ref}\n aria-label={description}\n disabled={isDisabled}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n <Tooltip.Body>{description}</Tooltip.Body>\n </Tooltip.Content>\n </Tooltip>\n );\n};\n\nSegmentedControlItem.displayName = 'SegmentedControl.Item';\n\nconst SegmentedControl = Object.assign(SegmentedControlComponent, {\n Item: SegmentedControlItem,\n});\n\nexport { SegmentedControl };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../src/segmented-control/SegmentedControl.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAG1B,KAAK,kBAAkB,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1C,KAAK,qBAAqB,CAAC,CAAC,SAAS,kBAAkB,IAAI;IACzD,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,sFAAsF;IACtF,YAAY,CAAC,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AQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;IAClE,oCAAoC;IACpC,QAAQ,EAAE,CAAC,CAAC;IACZ,sDAAsD;IACtD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAmEF,KAAK,yBAAyB,GAAG;IAC/B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AA0DF,QAAA,MAAM,gBAAgB;KApHpB,CAAC,SAAS,kBAAkB,EAC5B,CAAC,SAAS,KAAK,CAAC,WAAW,qIAc1B,sBAAsB,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;;;;SA6CxB,CAAC,SAAS,KAAK,CAAC,WAAW,kIAYtD,sBAAsB,CAAC,CAAC,EAAE,yBAAyB,CAAC;;;CA8CrD,CAAC;AAEH,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.38",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@tanstack/react-table": "8.21.3",
|
|
88
88
|
"react": ">=19.0.0",
|
|
89
89
|
"react-dom": ">=19.0.0",
|
|
90
|
-
"@neo4j-ndl/base": "^4.9.
|
|
90
|
+
"@neo4j-ndl/base": "^4.9.18"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@dnd-kit/core": "6.3.1",
|