@neo4j-ndl/react 2.0.0 → 2.0.2
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/CHANGELOG.md +12 -0
- package/lib/NOTICE.txt +2 -0
- package/lib/cjs/accordion/Accordion.js +1 -1
- package/lib/cjs/data-grid/datagrid-types.js +25 -0
- package/lib/cjs/data-grid/datagrid-types.js.map +1 -0
- package/lib/cjs/typography/Typography.js +0 -10
- package/lib/cjs/typography/Typography.js.map +1 -1
- package/lib/esm/accordion/Accordion.js +1 -1
- package/lib/esm/data-grid/datagrid-types.js +23 -0
- package/lib/esm/data-grid/datagrid-types.js.map +1 -0
- package/lib/esm/typography/Typography.js +1 -11
- package/lib/esm/typography/Typography.js.map +1 -1
- package/lib/types/context-menu/ContextMenu.d.ts +1 -0
- package/lib/types/data-grid/datagrid-types.d.ts +47 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 2.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#676](https://github.com/neo4j/neo4j-design/pull/676) [`eacf91b`](https://github.com/neo4j/neo4j-design/commit/eacf91b783a2eff210abb1876aa40d0b3d0ae467) Thanks [@basickarl](https://github.com/basickarl)! - Fixed spelling mistake.
|
|
8
|
+
|
|
9
|
+
## 2.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 42a28fc: rename datagrid-types file to be included in the tsc build properly
|
|
14
|
+
|
|
3
15
|
## 2.0.0
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
package/lib/NOTICE.txt
CHANGED
|
@@ -27,6 +27,8 @@ Third-party licenses
|
|
|
27
27
|
│ │ ├─ URL: https://github.com/babel/babel.git
|
|
28
28
|
│ │ ├─ VendorName: The Babel Team
|
|
29
29
|
│ │ └─ VendorUrl: https://babel.dev/docs/en/next/babel-core
|
|
30
|
+
│ ├─ [38;5;166m@changesets/[39m[38;5;173mchangelog-github[39m[38;5;111m@[39m[38;5;111mnpm:0.4.8[39m (via [38;5;37mnpm:^0.4.8[39m)
|
|
31
|
+
│ │ └─ URL: https://github.com/changesets/changesets/tree/main/packages/changelog-github
|
|
30
32
|
│ ├─ [38;5;166m@changesets/[39m[38;5;173mcli[39m[38;5;111m@[39m[38;5;111mnpm:2.26.1[39m (via [38;5;37mnpm:^2.22.0[39m)
|
|
31
33
|
│ │ ├─ URL: https://github.com/changesets/changesets/tree/main/packages/cli
|
|
32
34
|
│ │ └─ VendorName: Changesets Contributors
|
|
@@ -231,7 +231,7 @@ const AccordionItem = (_a) => {
|
|
|
231
231
|
'-n-rotate-180': isExpanded,
|
|
232
232
|
}) })] }) }) }), (0, jsx_runtime_1.jsx)("div", { id: panelElementId, ref: contentRef, className: contentClasses, "aria-hidden": !isExpanded, "aria-labelledby": buttonElementId, role: "region", children: (0, jsx_runtime_1.jsx)("div", { ref: innerContentRef, className: "ndl-accordion-item-content-inner", children: (0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: "body-medium", className: "n-text-palette-neutral-text-weak", as: "div", children: children }) }) })] })));
|
|
233
233
|
};
|
|
234
|
-
AccordionItem.displayName = '
|
|
234
|
+
AccordionItem.displayName = 'Accordion.Item';
|
|
235
235
|
// Issue with TypeScript forwardRef and subcomponents: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34757#issuecomment-894053907
|
|
236
236
|
// Fixes issue with: Accordion.Item = Item;
|
|
237
237
|
const Accordion = Object.assign(AccordionComponent, { Item: AccordionItem });
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
// eslint-disable-next-line import/no-duplicates
|
|
24
|
+
require("@tanstack/react-table");
|
|
25
|
+
//# sourceMappingURL=datagrid-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datagrid-types.js","sourceRoot":"","sources":["../../../src/data-grid/datagrid-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAKH,gDAAgD;AAChD,iCAA+B"}
|
|
@@ -34,7 +34,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
34
34
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
35
35
|
*/
|
|
36
36
|
const defaultImports_1 = require("../_common/defaultImports");
|
|
37
|
-
const utils_1 = require("../_common/utils");
|
|
38
37
|
const types_1 = require("./types");
|
|
39
38
|
const Typography = (props) => {
|
|
40
39
|
const { className = '', variant, as } = props, restProps = __rest(props, ["className", "variant", "as"]);
|
|
@@ -43,13 +42,4 @@ const Typography = (props) => {
|
|
|
43
42
|
return (0, jsx_runtime_1.jsx)(Component, Object.assign({}, restProps, { className: classes }));
|
|
44
43
|
};
|
|
45
44
|
exports.Typography = Typography;
|
|
46
|
-
/**
|
|
47
|
-
* Experimental Type testing
|
|
48
|
-
*/
|
|
49
|
-
const Link = ({ linkClick }) => ((0, jsx_runtime_1.jsx)("button", { onClick: linkClick, children: "Test" }));
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
51
|
-
// @ts-ignore
|
|
52
|
-
const _MultipleCasesComponent = () => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(exports.Typography, { variant: "h2", as: "a", href: "www.neo4j.com" }), (0, jsx_runtime_1.jsx)(exports.Typography, { variant: "h2", as: "span", href: "www.neo4j.com" }), (0, jsx_runtime_1.jsx)(exports.Typography, { variant: "body-medium", as: Link }), (0, jsx_runtime_1.jsx)(exports.Typography, { variant: "body-medium", as: Link, linkClick: () => {
|
|
53
|
-
(0, utils_1.needleWarningMessage)('clicked link');
|
|
54
|
-
} })] }));
|
|
55
45
|
//# sourceMappingURL=Typography.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,8DAAuD;AACvD,
|
|
1
|
+
{"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,8DAAuD;AACvD,mCAMiB;AAEV,MAAM,UAAU,GAAG,CAIxB,KAGoC,EACpC,EAAE;IACF,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,KAAmB,KAAK,EAAnB,SAAS,UAAK,KAAK,EAArD,8BAA6C,CAAQ,CAAC;IAE5D,MAAM,OAAO,GAAG,IAAA,2BAAU,EAAC,KAAK,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,gCAAwB,CAAC,OAAO,CAAC,CAAmB,CAAC;IAE9E,OAAO,uBAAC,SAAS,oBAAK,SAAS,IAAE,SAAS,EAAE,OAAO,IAAI,CAAC;AAC1D,CAAC,CAAC;AAfW,QAAA,UAAU,cAerB"}
|
|
@@ -228,7 +228,7 @@ const AccordionItem = (_a) => {
|
|
|
228
228
|
'-n-rotate-180': isExpanded,
|
|
229
229
|
}) })] }) }) }), _jsx("div", { id: panelElementId, ref: contentRef, className: contentClasses, "aria-hidden": !isExpanded, "aria-labelledby": buttonElementId, role: "region", children: _jsx("div", { ref: innerContentRef, className: "ndl-accordion-item-content-inner", children: _jsx(Typography, { variant: "body-medium", className: "n-text-palette-neutral-text-weak", as: "div", children: children }) }) })] })));
|
|
230
230
|
};
|
|
231
|
-
AccordionItem.displayName = '
|
|
231
|
+
AccordionItem.displayName = 'Accordion.Item';
|
|
232
232
|
// Issue with TypeScript forwardRef and subcomponents: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34757#issuecomment-894053907
|
|
233
233
|
// Fixes issue with: Accordion.Item = Item;
|
|
234
234
|
const Accordion = Object.assign(AccordionComponent, { Item: AccordionItem });
|
|
@@ -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
|
+
// eslint-disable-next-line import/no-duplicates
|
|
22
|
+
import '@tanstack/react-table';
|
|
23
|
+
//# sourceMappingURL=datagrid-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datagrid-types.js","sourceRoot":"","sources":["../../../src/data-grid/datagrid-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,gDAAgD;AAChD,OAAO,uBAAuB,CAAC"}
|
|
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
/**
|
|
14
14
|
*
|
|
15
15
|
* Copyright (c) "Neo4j"
|
|
@@ -31,7 +31,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
31
31
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
32
|
*/
|
|
33
33
|
import { classNames } from '../_common/defaultImports';
|
|
34
|
-
import { needleWarningMessage } from '../_common/utils';
|
|
35
34
|
import { TypographyDefaultMapping, } from './types';
|
|
36
35
|
export const Typography = (props) => {
|
|
37
36
|
const { className = '', variant, as } = props, restProps = __rest(props, ["className", "variant", "as"]);
|
|
@@ -39,13 +38,4 @@ export const Typography = (props) => {
|
|
|
39
38
|
const Component = (as || TypographyDefaultMapping[variant]);
|
|
40
39
|
return _jsx(Component, Object.assign({}, restProps, { className: classes }));
|
|
41
40
|
};
|
|
42
|
-
/**
|
|
43
|
-
* Experimental Type testing
|
|
44
|
-
*/
|
|
45
|
-
const Link = ({ linkClick }) => (_jsx("button", { onClick: linkClick, children: "Test" }));
|
|
46
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
47
|
-
// @ts-ignore
|
|
48
|
-
const _MultipleCasesComponent = () => (_jsxs("div", { children: [_jsx(Typography, { variant: "h2", as: "a", href: "www.neo4j.com" }), _jsx(Typography, { variant: "h2", as: "span", href: "www.neo4j.com" }), _jsx(Typography, { variant: "body-medium", as: Link }), _jsx(Typography, { variant: "body-medium", as: Link, linkClick: () => {
|
|
49
|
-
needleWarningMessage('clicked link');
|
|
50
|
-
} })] }));
|
|
51
41
|
//# sourceMappingURL=Typography.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EACL,wBAAwB,GAKzB,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,MAAM,UAAU,GAAG,CAIxB,KAGoC,EACpC,EAAE;IACF,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,KAAmB,KAAK,EAAnB,SAAS,UAAK,KAAK,EAArD,8BAA6C,CAAQ,CAAC;IAE5D,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,wBAAwB,CAAC,OAAO,CAAC,CAAmB,CAAC;IAE9E,OAAO,KAAC,SAAS,oBAAK,SAAS,IAAE,SAAS,EAAE,OAAO,IAAI,CAAC;AAC1D,CAAC,CAAC"}
|
|
@@ -63,6 +63,7 @@ interface StandardMenuItemProps extends Omit<ElementBase, 'title' | 'onClick' |
|
|
|
63
63
|
/** Enforces no children on standard menu item. Overridden by nested menu item*/
|
|
64
64
|
children?: never;
|
|
65
65
|
}
|
|
66
|
+
export type MenuItemProps = StandardMenuItemProps | NestedMenuItemProps;
|
|
66
67
|
declare const StandardMenuItem: React.ForwardRefExoticComponent<Omit<StandardMenuItemProps, "ref"> & React.RefAttributes<unknown>>;
|
|
67
68
|
interface MenuHeaderProps extends Omit<ElementBase, 'title'> {
|
|
68
69
|
/** Header title text */
|
|
@@ -0,0 +1,47 @@
|
|
|
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 RowData } from '@tanstack/react-table';
|
|
22
|
+
import { type MenuItemProps } from '../context-menu';
|
|
23
|
+
import '@tanstack/react-table';
|
|
24
|
+
export type ColumnAction = MenuItemProps;
|
|
25
|
+
export type RowAction = MenuItemProps;
|
|
26
|
+
declare module '@tanstack/table-core' {
|
|
27
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
28
|
+
columnActions?: {
|
|
29
|
+
/**
|
|
30
|
+
* Prepends two default sorting actions to the column.
|
|
31
|
+
* Should be disabled for columns that are sorted on server side.
|
|
32
|
+
*/
|
|
33
|
+
defaultSortingActions?: boolean;
|
|
34
|
+
/** Column actions that will be rendered in order */
|
|
35
|
+
actions?: ColumnAction[];
|
|
36
|
+
/** Callback for consumer to delegate task like polling */
|
|
37
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
38
|
+
};
|
|
39
|
+
/** If the column is an action column, including action array is mandatory */
|
|
40
|
+
isActionCell?: {
|
|
41
|
+
/** Column actions that will be rendered in order */
|
|
42
|
+
actions: RowAction[];
|
|
43
|
+
/** Callback for consumer to delegate tasks like polling */
|
|
44
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"scripts": {
|
|
43
43
|
"generate-component": "node ./scripts/component-generator.js",
|
|
44
44
|
"pretest": "yarn run lint",
|
|
45
|
-
"test": "vitest run",
|
|
45
|
+
"test": "vitest run && vitest typecheck --run",
|
|
46
46
|
"build": "yarn build:esm && yarn build:cjs && yarn build:types",
|
|
47
47
|
"build:esm": "tsc -p tsconfig.esm.json",
|
|
48
48
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|