@neo4j-ndl/react 2.1.1 → 2.3.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 (38) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/lib/NOTICE.txt +1 -1
  3. package/lib/cjs/breadcrumbs/Breadcrumbs.js +183 -0
  4. package/lib/cjs/breadcrumbs/Breadcrumbs.js.map +1 -0
  5. package/lib/cjs/breadcrumbs/index.js +38 -0
  6. package/lib/cjs/breadcrumbs/index.js.map +1 -0
  7. package/lib/cjs/index.js +3 -0
  8. package/lib/cjs/index.js.map +1 -1
  9. package/lib/cjs/layout/Box.js +56 -0
  10. package/lib/cjs/layout/Box.js.map +1 -0
  11. package/lib/cjs/layout/Flex.js +64 -0
  12. package/lib/cjs/layout/Flex.js.map +1 -0
  13. package/lib/cjs/layout/index.js +39 -0
  14. package/lib/cjs/layout/index.js.map +1 -0
  15. package/lib/cjs/layout/types.js +49 -0
  16. package/lib/cjs/layout/types.js.map +1 -0
  17. package/lib/esm/breadcrumbs/Breadcrumbs.js +180 -0
  18. package/lib/esm/breadcrumbs/Breadcrumbs.js.map +1 -0
  19. package/lib/esm/breadcrumbs/index.js +22 -0
  20. package/lib/esm/breadcrumbs/index.js.map +1 -0
  21. package/lib/esm/index.js +3 -0
  22. package/lib/esm/index.js.map +1 -1
  23. package/lib/esm/layout/Box.js +53 -0
  24. package/lib/esm/layout/Box.js.map +1 -0
  25. package/lib/esm/layout/Flex.js +61 -0
  26. package/lib/esm/layout/Flex.js.map +1 -0
  27. package/lib/esm/layout/index.js +23 -0
  28. package/lib/esm/layout/index.js.map +1 -0
  29. package/lib/esm/layout/types.js +44 -0
  30. package/lib/esm/layout/types.js.map +1 -0
  31. package/lib/types/breadcrumbs/Breadcrumbs.d.ts +98 -0
  32. package/lib/types/breadcrumbs/index.d.ts +21 -0
  33. package/lib/types/index.d.ts +3 -0
  34. package/lib/types/layout/Box.d.ts +66 -0
  35. package/lib/types/layout/Flex.d.ts +80 -0
  36. package/lib/types/layout/index.d.ts +22 -0
  37. package/lib/types/layout/types.d.ts +48 -0
  38. package/package.json +2 -2
@@ -0,0 +1,80 @@
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 React, { type ComponentPropsWithoutRef } from 'react';
22
+ import { type CustomElementType, type Spacing, type Radius } from './types';
23
+ type AllowedFlexElements = 'div' | 'span' | 'ul' | 'ol' | 'li';
24
+ type BaseFlexProps<T extends CustomElementType> = {
25
+ /**
26
+ * The DOM element to render as the Flex,
27
+ * meaning the root node of the children collection.
28
+ * @default div
29
+ */
30
+ as?: AllowedFlexElements;
31
+ /**
32
+ * @default tokens.space['4']
33
+ */
34
+ gap?: Spacing;
35
+ /**
36
+ * @default undefined
37
+ */
38
+ rowGap?: Spacing;
39
+ /**
40
+ * @default undefined
41
+ */
42
+ columnGap?: Spacing;
43
+ /**
44
+ * @default undefined
45
+ */
46
+ borderRadius?: Radius;
47
+ /**
48
+ * Flex direction is set to column by default.
49
+ * The `row-reverse` and `column-reverse` values
50
+ * are skipped due to accessibility concerns.
51
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction#accessibility_concerns
52
+ *
53
+ * @default row
54
+ */
55
+ flexDirection?: Exclude<React.CSSProperties['flexDirection'], 'row-reverse' | 'column-reverse'>;
56
+ /**
57
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap
58
+ * @default nowrap
59
+ */
60
+ flexWrap?: React.CSSProperties['flexWrap'];
61
+ /**
62
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content
63
+ * @default undefined
64
+ */
65
+ justifyContent?: React.CSSProperties['justifyContent'];
66
+ /**
67
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/align-items
68
+ * @default undefined
69
+ */
70
+ alignItems?: React.CSSProperties['alignItems'];
71
+ children?: React.ReactNode;
72
+ };
73
+ export type FlexProps<T extends CustomElementType> = Omit<ComponentPropsWithoutRef<T>, 'as'> & BaseFlexProps<T>;
74
+ type FlexComponent = <T extends CustomElementType>(props: FlexProps<T>) => React.ReactNode;
75
+ /**
76
+ * Flex is a general-purpose container that helps
77
+ * lay out components with consistent spacing in a row or column.
78
+ */
79
+ export declare const Flex: FlexComponent;
80
+ export {};
@@ -0,0 +1,22 @@
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 './Flex';
22
+ export * from './Box';
@@ -0,0 +1,48 @@
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
+ /// <reference types="react" />
22
+ import { tokens } from '@neo4j-ndl/base';
23
+ /**
24
+ * Currently supporting only native HTML elements.
25
+ * @todo Allow custom React components as well, like Typography.tsx does.
26
+ */
27
+ export type CustomElementType = keyof HTMLElementTagNameMap;
28
+ /**
29
+ * More info here:
30
+ * https://stackoverflow.com/questions/75085783/conditional-react-component-properties-with-multiple-generics#comment132505139_75086121
31
+ */
32
+ export type ReactComponent = (args: any) => JSX.Element;
33
+ export type Spacing = keyof typeof tokens.space;
34
+ export declare const SpacingDefaults: {
35
+ readonly padding: "4";
36
+ readonly paddingBlockStart: undefined;
37
+ readonly paddingBlockEnd: undefined;
38
+ readonly paddingInline: undefined;
39
+ readonly paddingInlineStart: undefined;
40
+ readonly paddingInlineEnd: undefined;
41
+ readonly gap: "4";
42
+ };
43
+ export declare const getSpacing: (spacing: Spacing | undefined, property: keyof typeof SpacingDefaults) => string | undefined;
44
+ export type Radius = keyof typeof tokens.borderRadius;
45
+ export declare const RadiusDefaults: {
46
+ borderRadius: undefined;
47
+ };
48
+ export declare const getRadius: (spacing: Radius | undefined, property: keyof typeof RadiusDefaults) => string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-ndl/react",
3
- "version": "2.1.1",
3
+ "version": "2.3.0",
4
4
  "sideEffects": false,
5
5
  "description": "React implementation of Neo4j Design System",
6
6
  "keywords": [
@@ -93,7 +93,7 @@
93
93
  "@floating-ui/react": "0.25.1",
94
94
  "@heroicons/react": "2.0.13",
95
95
  "@neo4j-cypher/react-codemirror": "^1.0.1",
96
- "@neo4j-ndl/base": "^2.1.1",
96
+ "@neo4j-ndl/base": "^2.3.0",
97
97
  "@table-nav/core": "0.0.7",
98
98
  "@table-nav/react": "0.0.7",
99
99
  "@tanstack/react-table": "^8.9.3",