@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.
- package/CHANGELOG.md +24 -0
- package/lib/NOTICE.txt +1 -1
- package/lib/cjs/breadcrumbs/Breadcrumbs.js +183 -0
- package/lib/cjs/breadcrumbs/Breadcrumbs.js.map +1 -0
- package/lib/cjs/breadcrumbs/index.js +38 -0
- package/lib/cjs/breadcrumbs/index.js.map +1 -0
- package/lib/cjs/index.js +3 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/layout/Box.js +56 -0
- package/lib/cjs/layout/Box.js.map +1 -0
- package/lib/cjs/layout/Flex.js +64 -0
- package/lib/cjs/layout/Flex.js.map +1 -0
- package/lib/cjs/layout/index.js +39 -0
- package/lib/cjs/layout/index.js.map +1 -0
- package/lib/cjs/layout/types.js +49 -0
- package/lib/cjs/layout/types.js.map +1 -0
- package/lib/esm/breadcrumbs/Breadcrumbs.js +180 -0
- package/lib/esm/breadcrumbs/Breadcrumbs.js.map +1 -0
- package/lib/esm/breadcrumbs/index.js +22 -0
- package/lib/esm/breadcrumbs/index.js.map +1 -0
- package/lib/esm/index.js +3 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/layout/Box.js +53 -0
- package/lib/esm/layout/Box.js.map +1 -0
- package/lib/esm/layout/Flex.js +61 -0
- package/lib/esm/layout/Flex.js.map +1 -0
- package/lib/esm/layout/index.js +23 -0
- package/lib/esm/layout/index.js.map +1 -0
- package/lib/esm/layout/types.js +44 -0
- package/lib/esm/layout/types.js.map +1 -0
- package/lib/types/breadcrumbs/Breadcrumbs.d.ts +98 -0
- package/lib/types/breadcrumbs/index.d.ts +21 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/layout/Box.d.ts +66 -0
- package/lib/types/layout/Flex.d.ts +80 -0
- package/lib/types/layout/index.d.ts +22 -0
- package/lib/types/layout/types.d.ts +48 -0
- package/package.json +2 -2
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) "Neo4j"
|
|
16
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
17
|
+
*
|
|
18
|
+
* This file is part of Neo4j.
|
|
19
|
+
*
|
|
20
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
21
|
+
* it under the terms of the GNU General Public License as published by
|
|
22
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
23
|
+
* (at your option) any later version.
|
|
24
|
+
*
|
|
25
|
+
* This program is distributed in the hope that it will be useful,
|
|
26
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
27
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
28
|
+
* GNU General Public License for more details.
|
|
29
|
+
*
|
|
30
|
+
* You should have received a copy of the GNU General Public License
|
|
31
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
|
+
*/
|
|
33
|
+
// NPM
|
|
34
|
+
import { Menu } from '../context-menu';
|
|
35
|
+
import { IconButton } from '../button';
|
|
36
|
+
import { useRef, useState } from 'react';
|
|
37
|
+
// Local
|
|
38
|
+
import { classNames } from '../_common/defaultImports';
|
|
39
|
+
import { HomeIconOutline, ChevronDownIconOutline } from '../icons';
|
|
40
|
+
import { Typography } from '../typography';
|
|
41
|
+
const BreadcrumbsBaseItem = (_a) => {
|
|
42
|
+
var { as = 'a', children = _jsx(HomeIconOutline, {}), className, href, isCurrentPage = false, onClick } = _a, restProps = __rest(_a, ["as", "children", "className", "href", "isCurrentPage", "onClick"]);
|
|
43
|
+
const Component = as;
|
|
44
|
+
const classes = classNames('ndl-breadcrumbs-base-item-link', className, {
|
|
45
|
+
'ndl-breadcrumbs-base-item-link-active': isCurrentPage,
|
|
46
|
+
});
|
|
47
|
+
return (_jsx("li", { className: "ndl-breadcrumbs-base-item", children: _jsx(Component
|
|
48
|
+
/* Overridable */
|
|
49
|
+
, Object.assign({
|
|
50
|
+
/* Overridable */
|
|
51
|
+
role: "button", tabIndex: 0 }, restProps, {
|
|
52
|
+
/* Non-overridable */
|
|
53
|
+
className: classes, href: href, onClick: (event) => {
|
|
54
|
+
if (onClick)
|
|
55
|
+
onClick(event, href);
|
|
56
|
+
}, children: children })) }));
|
|
57
|
+
};
|
|
58
|
+
BreadcrumbsBaseItem.displayName = 'Breadcrumbs.BaseItem';
|
|
59
|
+
const BreadcrumbsGroupItem = (_a) => {
|
|
60
|
+
var { as = 'li', children, className } = _a, restProps = __rest(_a, ["as", "children", "className"]);
|
|
61
|
+
const Component = as;
|
|
62
|
+
const classes = classNames('ndl-breadcrumbs-group-item', className);
|
|
63
|
+
return (_jsx(Component
|
|
64
|
+
/* Overridable */
|
|
65
|
+
, Object.assign({}, restProps, {
|
|
66
|
+
/* Non-overridable */
|
|
67
|
+
className: classes, children: _jsx("ol", { children: children }) })));
|
|
68
|
+
};
|
|
69
|
+
BreadcrumbsGroupItem.displayName = 'Breadcrumbs.GroupItem';
|
|
70
|
+
const BreadcrumbsItem = (_a) => {
|
|
71
|
+
var { as = 'a', children, className, hasSeparator = true, href, isCurrentPage = false, onClick } = _a, restProps = __rest(_a, ["as", "children", "className", "hasSeparator", "href", "isCurrentPage", "onClick"]);
|
|
72
|
+
const listItemClasses = classNames('ndl-breadcrumbs-item', {
|
|
73
|
+
'ndl-breadcrumbs-separator': hasSeparator,
|
|
74
|
+
});
|
|
75
|
+
const linkClasses = classNames('ndl-breadcrumbs-item-link', {
|
|
76
|
+
'ndl-breadcrumbs-item-link-active': isCurrentPage,
|
|
77
|
+
}, className);
|
|
78
|
+
return (_jsx("li", { className: listItemClasses, children: _jsx(Typography
|
|
79
|
+
/* Overridable */
|
|
80
|
+
, Object.assign({ "aria-current": isCurrentPage ? 'page' : undefined, as: as, role: "button", tabIndex: 0, variant: "body-medium" }, restProps, {
|
|
81
|
+
/* Non-overridable */
|
|
82
|
+
className: linkClasses, href: href, onClick: (event) => {
|
|
83
|
+
if (onClick)
|
|
84
|
+
onClick(event, href);
|
|
85
|
+
}, children: children })) }));
|
|
86
|
+
};
|
|
87
|
+
BreadcrumbsItem.displayName = 'Breadcrumbs.Item';
|
|
88
|
+
const BreadcrumbsItemMenu = (_a) => {
|
|
89
|
+
var { children, className, isOpen = false, onClick, onClose } = _a, restProps = __rest(_a, ["children", "className", "isOpen", "onClick", "onClose"]);
|
|
90
|
+
const buttonRef = useRef(null);
|
|
91
|
+
const [isItemMenuOpen, setIsItemMenuOpen] = useState(isOpen);
|
|
92
|
+
const classes = classNames('ndl-breadcrumbs-item-menu-button', className);
|
|
93
|
+
return (_jsxs("li", { className: "ndl-breadcrumbs-item-menu", children: [_jsx(IconButton
|
|
94
|
+
/* Overridable */
|
|
95
|
+
, Object.assign({ "aria-haspopup": "true", "aria-label": "breadcrumbs item menu", clean: true, grouped: true, size: "small" }, restProps, {
|
|
96
|
+
/* Non-overridable */
|
|
97
|
+
className: classes, onClick: (event) => {
|
|
98
|
+
setIsItemMenuOpen(true);
|
|
99
|
+
if (onClick)
|
|
100
|
+
onClick(event);
|
|
101
|
+
}, ref: buttonRef, children: _jsx(ChevronDownIconOutline, {}) })), _jsx(Menu, { anchorEl: buttonRef, anchorOrigin: {
|
|
102
|
+
vertical: 'bottom',
|
|
103
|
+
horizontal: 'center',
|
|
104
|
+
}, captureFocus: true, onClose: (event) => {
|
|
105
|
+
setIsItemMenuOpen(false);
|
|
106
|
+
if (onClose)
|
|
107
|
+
onClose(event);
|
|
108
|
+
}, open: isItemMenuOpen, transformOrigin: { vertical: 'top', horizontal: 'left' }, children: _jsx(Menu.Items, { children: children }) })] }));
|
|
109
|
+
};
|
|
110
|
+
BreadcrumbsItemMenu.displayName = 'Breadcrumbs.ItemMenu';
|
|
111
|
+
const BreadcrumbsEllipsisMenu = (_a) => {
|
|
112
|
+
var { as = 'span', children, className, isOpen = false, onClick, onClose, onKeyDown } = _a, restProps = __rest(_a, ["as", "children", "className", "isOpen", "onClick", "onClose", "onKeyDown"]);
|
|
113
|
+
const ellipsisButtonRef = useRef(null);
|
|
114
|
+
const ellipsisMenuRef = useRef(null);
|
|
115
|
+
const [isEllipsisMenuOpen, setIsEllipsisMenuOpen] = useState(isOpen);
|
|
116
|
+
const Component = as;
|
|
117
|
+
const classes = classNames('ndl-breadcrumbs-ellipsis-menu-button', className);
|
|
118
|
+
return (_jsxs("li", { className: "ndl-breadcrumbs-ellipsis-menu ndl-breadcrumbs-separator", children: [_jsx(Component
|
|
119
|
+
/* Overridable */
|
|
120
|
+
, Object.assign({ "aria-controls": isEllipsisMenuOpen ? 'ellipsis-menu' : undefined, "aria-expanded": isEllipsisMenuOpen ? 'true' : undefined, "aria-haspopup": "true", role: "button", tabIndex: 0 }, restProps, {
|
|
121
|
+
/* Non-overridable */
|
|
122
|
+
className: classes, onClick: (event) => {
|
|
123
|
+
setIsEllipsisMenuOpen(true);
|
|
124
|
+
if (onClick)
|
|
125
|
+
onClick(event);
|
|
126
|
+
}, onKeyDown: (event) => {
|
|
127
|
+
if (event.key === 'Enter')
|
|
128
|
+
setIsEllipsisMenuOpen(true);
|
|
129
|
+
if (onKeyDown)
|
|
130
|
+
onKeyDown(event);
|
|
131
|
+
}, ref: ellipsisButtonRef, children: "\u2026" })), _jsx(Menu, { anchorEl: ellipsisButtonRef, captureFocus: true, onClose: (event) => {
|
|
132
|
+
setIsEllipsisMenuOpen(false);
|
|
133
|
+
if (onClose)
|
|
134
|
+
onClose(event);
|
|
135
|
+
}, open: isEllipsisMenuOpen, ref: ellipsisMenuRef, children: _jsx(Menu.Items, { children: children }) })] }));
|
|
136
|
+
};
|
|
137
|
+
BreadcrumbsEllipsisMenu.displayName = 'Breadcrumbs.EllipsisMenu';
|
|
138
|
+
const BreadcrumbsMenuItem = (_a) => {
|
|
139
|
+
var { as = 'span', children, className, href, isCurrentPage = false, onClick } = _a, restProps = __rest(_a, ["as", "children", "className", "href", "isCurrentPage", "onClick"]);
|
|
140
|
+
const linkClasses = classNames('ndl-breadcrumbs-item-link', className, {
|
|
141
|
+
'ndl-breadcrumbs-item-link-active': isCurrentPage,
|
|
142
|
+
});
|
|
143
|
+
return (_jsx(Menu.Item, { as: as, className: "ndl-breadcrumbs-menu-item", title: href ? (_jsx(Typography
|
|
144
|
+
/* Overridable */
|
|
145
|
+
, Object.assign({ "aria-current": isCurrentPage ? 'page' : undefined, as: as, role: "button", tabIndex: 0, variant: "body-medium" }, restProps, {
|
|
146
|
+
/* Non-overridable */
|
|
147
|
+
className: linkClasses, href: href, onClick: (event) => {
|
|
148
|
+
if (onClick)
|
|
149
|
+
onClick(event, href);
|
|
150
|
+
}, children: children }))) : (_jsx(Typography
|
|
151
|
+
/* Overridable */
|
|
152
|
+
, Object.assign({
|
|
153
|
+
/* Overridable */
|
|
154
|
+
as: as, tabIndex: -1, variant: "body-medium" }, restProps, {
|
|
155
|
+
/* Non-overridable */
|
|
156
|
+
className: linkClasses, children: children }))) }));
|
|
157
|
+
};
|
|
158
|
+
BreadcrumbsMenuItem.displayName = 'Breadcrumbs.MenuItem';
|
|
159
|
+
const BreadcrumbsComponent = (_a) => {
|
|
160
|
+
var { as = 'nav', children, className } = _a, restProps = __rest(_a, ["as", "children", "className"]);
|
|
161
|
+
const Component = as;
|
|
162
|
+
const classes = classNames('ndl-breadcrumbs', className);
|
|
163
|
+
return (_jsx(Component
|
|
164
|
+
/* Overridable */
|
|
165
|
+
, Object.assign({ "aria-label": "breadcrumb" }, restProps, {
|
|
166
|
+
/* Non-overridable */
|
|
167
|
+
className: classes, children: _jsx("ol", { children: children }) })));
|
|
168
|
+
};
|
|
169
|
+
BreadcrumbsComponent.displayName = 'Breadcrumbs';
|
|
170
|
+
// Issue with TypeScript forwardRef and subcomponents: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34757#issuecomment-894053907
|
|
171
|
+
const Breadcrumbs = Object.assign(BreadcrumbsComponent, {
|
|
172
|
+
BaseItem: BreadcrumbsBaseItem,
|
|
173
|
+
GroupItem: BreadcrumbsGroupItem,
|
|
174
|
+
Item: BreadcrumbsItem,
|
|
175
|
+
ItemMenu: BreadcrumbsItemMenu,
|
|
176
|
+
EllipsisMenu: BreadcrumbsEllipsisMenu,
|
|
177
|
+
MenuItem: BreadcrumbsMenuItem,
|
|
178
|
+
});
|
|
179
|
+
export { Breadcrumbs };
|
|
180
|
+
//# sourceMappingURL=Breadcrumbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.js","sourceRoot":"","sources":["../../../src/breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM;AACN,OAAO,EAAE,IAAI,EAAyB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,QAAQ;AACR,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAe3C,MAAM,mBAAmB,GA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;AACJ,CAAC,CAAC;AACF,mBAAmB,CAAC,WAAW,GAAG,sBAAsB,CAAC;AAQzD,MAAM,oBAAoB,GAAG,CAAC,EAKX,EAAE,EAAE;QALO,EAC5B,EAAE,GAAG,KAAK,EACV,QAAQ,EACR,SAAS,OAEQ,EADd,SAAS,cAJgB,+BAK7B,CADa;IAEZ,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;IAEzD,OAAO,CACL,KAAC,SAAS;IACR,iBAAiB;oCACN,YAAY,IACnB,SAAS;QACb,qBAAqB;QACrB,SAAS,EAAE,OAAO,YAElB,uBAAK,QAAQ,GAAM,IACT,CACb,CAAC;AACJ,CAAC,CAAC;AACF,oBAAoB,CAAC,WAAW,GAAG,aAAa,CAAC;AAEjD,6IAA6I;AAC7I,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE;IACtD,QAAQ,EAAE,mBAAmB;IAC7B,SAAS,EAAE,oBAAoB;IAC/B,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,mBAAmB;IAC7B,YAAY,EAAE,uBAAuB;IACrC,QAAQ,EAAE,mBAAmB;CAC9B,CAAC,CAAC;AAEH,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -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 './Breadcrumbs';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/breadcrumbs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,eAAe,CAAC"}
|
package/lib/esm/index.js
CHANGED
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AAC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C;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) "Neo4j"
|
|
16
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
17
|
+
*
|
|
18
|
+
* This file is part of Neo4j.
|
|
19
|
+
*
|
|
20
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
21
|
+
* it under the terms of the GNU General Public License as published by
|
|
22
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
23
|
+
* (at your option) any later version.
|
|
24
|
+
*
|
|
25
|
+
* This program is distributed in the hope that it will be useful,
|
|
26
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
27
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
28
|
+
* GNU General Public License for more details.
|
|
29
|
+
*
|
|
30
|
+
* You should have received a copy of the GNU General Public License
|
|
31
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
|
+
*/
|
|
33
|
+
import { forwardRef, } from 'react';
|
|
34
|
+
import { getSpacing, getRadius, } from './types';
|
|
35
|
+
/**
|
|
36
|
+
* Box is a general-purpose container that allows for controlled use of design tokens.
|
|
37
|
+
* Use the given props to configure display behavior and styling that aligns with Needle's tokens.
|
|
38
|
+
*/
|
|
39
|
+
export const Box = forwardRef(function Box(_a, ref) {
|
|
40
|
+
var { as = 'div', padding, paddingInline, paddingInlineStart, paddingInlineEnd, paddingBlockEnd, paddingBlockStart, borderRadius, children } = _a, restProps = __rest(_a, ["as", "padding", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlockEnd", "paddingBlockStart", "borderRadius", "children"]);
|
|
41
|
+
const Component = as;
|
|
42
|
+
const style = {
|
|
43
|
+
padding: getSpacing(padding, 'padding'),
|
|
44
|
+
paddingInline: getSpacing(paddingInline, 'paddingInline'),
|
|
45
|
+
paddingInlineStart: getSpacing(paddingInlineStart, 'paddingInlineStart'),
|
|
46
|
+
paddingInlineEnd: getSpacing(paddingInlineEnd, 'paddingInlineEnd'),
|
|
47
|
+
paddingBlockEnd: getSpacing(paddingBlockEnd, 'paddingBlockEnd'),
|
|
48
|
+
paddingBlockStart: getSpacing(paddingBlockStart, 'paddingBlockStart'),
|
|
49
|
+
borderRadius: getRadius(borderRadius, 'borderRadius'),
|
|
50
|
+
};
|
|
51
|
+
return (_jsx(Component, Object.assign({ ref: ref }, restProps, { style: Object.assign(Object.assign({}, style), restProps.style), children: children })));
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=Box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Box.js","sourceRoot":"","sources":["../../../src/layout/Box.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAc,EACZ,UAAU,GAGX,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,UAAU,EACV,SAAS,GACV,MAAM,SAAS,CAAC;AAiDjB;;;GAGG;AACH,MAAM,CAAC,MAAM,GAAG,GAAiB,UAAU,CAAC,SAAS,GAAG,CAGtD,EAWc,EACd,GAAoC;QAZpC,EACE,EAAE,GAAG,KAAU,EACf,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,QAAQ,OAEI,EADT,SAAS,cAVd,gJAWC,CADa;IAId,MAAM,SAAS,GAAG,EAA+B,CAAC;IAElD,MAAM,KAAK,GAAG;QACZ,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC;QACvC,aAAa,EAAE,UAAU,CAAC,aAAa,EAAE,eAAe,CAAC;QACzD,kBAAkB,EAAE,UAAU,CAAC,kBAAkB,EAAE,oBAAoB,CAAC;QACxE,gBAAgB,EAAE,UAAU,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;QAClE,eAAe,EAAE,UAAU,CAAC,eAAe,EAAE,iBAAiB,CAAC;QAC/D,iBAAiB,EAAE,UAAU,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;QACrE,YAAY,EAAE,SAAS,CAAC,YAAY,EAAE,cAAc,CAAC;KACtD,CAAC;IAEF,OAAO,CACL,KAAC,SAAS,kBACR,GAAG,EAAE,GAAG,IACJ,SAAS,IACb,KAAK,kCAAO,KAAK,GAAK,SAAS,CAAC,KAAK,aAEpC,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) "Neo4j"
|
|
16
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
17
|
+
*
|
|
18
|
+
* This file is part of Neo4j.
|
|
19
|
+
*
|
|
20
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
21
|
+
* it under the terms of the GNU General Public License as published by
|
|
22
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
23
|
+
* (at your option) any later version.
|
|
24
|
+
*
|
|
25
|
+
* This program is distributed in the hope that it will be useful,
|
|
26
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
27
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
28
|
+
* GNU General Public License for more details.
|
|
29
|
+
*
|
|
30
|
+
* You should have received a copy of the GNU General Public License
|
|
31
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
|
+
*/
|
|
33
|
+
import { forwardRef, } from 'react';
|
|
34
|
+
import { getSpacing, getRadius, } from './types';
|
|
35
|
+
import { tokens } from '@neo4j-ndl/base';
|
|
36
|
+
/**
|
|
37
|
+
* Flex is a general-purpose container that helps
|
|
38
|
+
* lay out components with consistent spacing in a row or column.
|
|
39
|
+
*/
|
|
40
|
+
export const Flex = forwardRef(function Flex(_a, ref) {
|
|
41
|
+
var { as = 'div', gap = '4', rowGap, columnGap, children, borderRadius, flexDirection = 'column', flexWrap = 'nowrap', alignItems, justifyContent } = _a, restProps = __rest(_a, ["as", "gap", "rowGap", "columnGap", "children", "borderRadius", "flexDirection", "flexWrap", "alignItems", "justifyContent"]);
|
|
42
|
+
const Component = as;
|
|
43
|
+
// If gap is not provided,
|
|
44
|
+
// and rowGap and columnGap are not provided,
|
|
45
|
+
// then use the default value.
|
|
46
|
+
const gapPx = getSpacing(gap, 'gap');
|
|
47
|
+
const rowGapPx = rowGap ? tokens.space[rowGap] : undefined;
|
|
48
|
+
const columnGapPx = columnGap ? tokens.space[columnGap] : undefined;
|
|
49
|
+
const gapFormatted = `${rowGapPx !== null && rowGapPx !== void 0 ? rowGapPx : gapPx} ${columnGapPx !== null && columnGapPx !== void 0 ? columnGapPx : gapPx}`;
|
|
50
|
+
const style = {
|
|
51
|
+
flexDirection,
|
|
52
|
+
alignItems,
|
|
53
|
+
flexWrap,
|
|
54
|
+
justifyContent,
|
|
55
|
+
display: 'flex',
|
|
56
|
+
gap: gapFormatted,
|
|
57
|
+
borderRadius: getRadius(borderRadius, 'borderRadius'),
|
|
58
|
+
};
|
|
59
|
+
return (_jsx(Component, Object.assign({ ref: ref }, restProps, { style: Object.assign(Object.assign({}, style), restProps.style), children: children })));
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=Flex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flex.js","sourceRoot":"","sources":["../../../src/layout/Flex.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAc,EACZ,UAAU,GAGX,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,UAAU,EACV,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAmEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAkB,UAAU,CAAC,SAAS,IAAI,CAGzD,EAYe,EACf,GAAoC;QAbpC,EACE,EAAE,GAAG,KAAU,EACf,GAAG,GAAG,GAAG,EACT,MAAM,EACN,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,aAAa,GAAG,QAAQ,EACxB,QAAQ,GAAG,QAAQ,EACnB,UAAU,EACV,cAAc,OAED,EADV,SAAS,cAXd,6HAYC,CADa;IAId,MAAM,SAAS,GAAG,EAA+B,CAAC;IAElD,0BAA0B;IAC1B,6CAA6C;IAC7C,8BAA8B;IAC9B,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3D,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACpE,MAAM,YAAY,GAAG,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,KAAK,IAAI,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,KAAK,EAAE,CAAC;IAEpE,MAAM,KAAK,GAAwB;QACjC,aAAa;QACb,UAAU;QACV,QAAQ;QACR,cAAc;QACd,OAAO,EAAE,MAAM;QACf,GAAG,EAAE,YAAY;QACjB,YAAY,EAAE,SAAS,CAAC,YAAY,EAAE,cAAc,CAAC;KACtD,CAAC;IAEF,OAAO,CACL,KAAC,SAAS,kBACR,GAAG,EAAE,GAAG,IACJ,SAAS,IACb,KAAK,kCAAO,KAAK,GAAK,SAAS,CAAC,KAAK,aAEpC,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -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
|
+
export * from './Flex';
|
|
22
|
+
export * from './Box';
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/layout/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 { tokens } from '@neo4j-ndl/base';
|
|
22
|
+
export const SpacingDefaults = {
|
|
23
|
+
padding: '4',
|
|
24
|
+
paddingBlockStart: undefined,
|
|
25
|
+
paddingBlockEnd: undefined,
|
|
26
|
+
paddingInline: undefined,
|
|
27
|
+
paddingInlineStart: undefined,
|
|
28
|
+
paddingInlineEnd: undefined,
|
|
29
|
+
gap: '4',
|
|
30
|
+
};
|
|
31
|
+
export const getSpacing = (spacing, property) => {
|
|
32
|
+
return spacing
|
|
33
|
+
? tokens.space[spacing || SpacingDefaults[property]]
|
|
34
|
+
: undefined;
|
|
35
|
+
};
|
|
36
|
+
export const RadiusDefaults = {
|
|
37
|
+
borderRadius: undefined,
|
|
38
|
+
};
|
|
39
|
+
export const getRadius = (spacing, property) => {
|
|
40
|
+
return spacing
|
|
41
|
+
? tokens.borderRadius[spacing || RadiusDefaults[property]]
|
|
42
|
+
: undefined;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/layout/types.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAgBzC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,GAAG;IACZ,iBAAiB,EAAE,SAAS;IAC5B,eAAe,EAAE,SAAS;IAC1B,aAAa,EAAE,SAAS;IACxB,kBAAkB,EAAE,SAAS;IAC7B,gBAAgB,EAAE,SAAS;IAC3B,GAAG,EAAE,GAAG;CACA,CAAC;AAEX,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,OAA4B,EAC5B,QAAsC,EACtC,EAAE;IACF,OAAO,OAAO;QACZ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC;QACpD,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC,CAAC;AAIF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,YAAY,EAAE,SAAS;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,OAA2B,EAC3B,QAAqC,EACrC,EAAE;IACF,OAAO,OAAO;QACZ,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC1D,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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 ContextMenuProps } from '../context-menu';
|
|
22
|
+
import React from 'react';
|
|
23
|
+
export interface BreadcrumbsBaseItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'as' | 'onClick'> {
|
|
24
|
+
as?: string | React.ComponentType<any>;
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
href: string;
|
|
28
|
+
isCurrentPage?: boolean;
|
|
29
|
+
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href: string) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface BreadcrumbsGroupItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'as'> {
|
|
32
|
+
as?: string | React.ComponentType<any>;
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface BreadcrumbsItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'as' | 'onClick'> {
|
|
37
|
+
as?: string | React.ComponentType<any>;
|
|
38
|
+
children: React.ReactNode;
|
|
39
|
+
className?: string;
|
|
40
|
+
hasSeparator?: boolean;
|
|
41
|
+
href: string;
|
|
42
|
+
isCurrentPage?: boolean;
|
|
43
|
+
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href: string) => void;
|
|
44
|
+
}
|
|
45
|
+
export interface BreadcrumbsItemMenuProps extends Omit<ContextMenuProps, 'open'> {
|
|
46
|
+
children: React.ReactNode;
|
|
47
|
+
className?: string;
|
|
48
|
+
isOpen?: boolean;
|
|
49
|
+
onClick?: (event: React.MouseEvent<HTMLElement> | undefined) => void;
|
|
50
|
+
onClose?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void;
|
|
51
|
+
}
|
|
52
|
+
export interface BreadcrumbsEllipsisMenuProps extends Omit<ContextMenuProps, 'open'> {
|
|
53
|
+
isOpen?: boolean;
|
|
54
|
+
onClose?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void;
|
|
55
|
+
}
|
|
56
|
+
export interface BreadcrumbsMenuItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'as' | 'onClick'> {
|
|
57
|
+
as?: string | React.ComponentType<any>;
|
|
58
|
+
children: React.ReactNode;
|
|
59
|
+
className?: string;
|
|
60
|
+
href?: string;
|
|
61
|
+
isCurrentPage?: boolean;
|
|
62
|
+
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href?: string) => void;
|
|
63
|
+
}
|
|
64
|
+
export interface BreadcrumbsProps {
|
|
65
|
+
as?: string | React.ComponentType<any>;
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
className?: string;
|
|
68
|
+
}
|
|
69
|
+
declare const Breadcrumbs: {
|
|
70
|
+
({ as, children, className, ...restProps }: BreadcrumbsProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
displayName: string;
|
|
72
|
+
} & {
|
|
73
|
+
BaseItem: {
|
|
74
|
+
({ as, children, className, href, isCurrentPage, onClick, ...restProps }: BreadcrumbsBaseItemProps): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
displayName: string;
|
|
76
|
+
};
|
|
77
|
+
GroupItem: {
|
|
78
|
+
({ as, children, className, ...restProps }: BreadcrumbsGroupItemProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
displayName: string;
|
|
80
|
+
};
|
|
81
|
+
Item: {
|
|
82
|
+
({ as, children, className, hasSeparator, href, isCurrentPage, onClick, ...restProps }: BreadcrumbsItemProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
displayName: string;
|
|
84
|
+
};
|
|
85
|
+
ItemMenu: {
|
|
86
|
+
({ children, className, isOpen, onClick, onClose, ...restProps }: BreadcrumbsItemMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
displayName: string;
|
|
88
|
+
};
|
|
89
|
+
EllipsisMenu: {
|
|
90
|
+
({ as, children, className, isOpen, onClick, onClose, onKeyDown, ...restProps }: BreadcrumbsEllipsisMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
91
|
+
displayName: string;
|
|
92
|
+
};
|
|
93
|
+
MenuItem: {
|
|
94
|
+
({ as, children, className, href, isCurrentPage, onClick, ...restProps }: BreadcrumbsMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
displayName: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export { Breadcrumbs };
|
|
@@ -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 './Breadcrumbs';
|
package/lib/types/index.d.ts
CHANGED
|
@@ -0,0 +1,66 @@
|
|
|
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 BaseBoxProps<T extends CustomElementType> = {
|
|
24
|
+
/**
|
|
25
|
+
* The DOM element to render as the Box.
|
|
26
|
+
* @default div
|
|
27
|
+
*/
|
|
28
|
+
as?: T;
|
|
29
|
+
/**
|
|
30
|
+
* @default tokens.space['4']
|
|
31
|
+
*/
|
|
32
|
+
padding?: Spacing;
|
|
33
|
+
/**
|
|
34
|
+
* @default undefined
|
|
35
|
+
*/
|
|
36
|
+
paddingBlockStart?: Spacing;
|
|
37
|
+
/**
|
|
38
|
+
* @default undefined
|
|
39
|
+
*/
|
|
40
|
+
paddingBlockEnd?: Spacing;
|
|
41
|
+
/**
|
|
42
|
+
* @default undefined
|
|
43
|
+
*/
|
|
44
|
+
paddingInline?: Spacing;
|
|
45
|
+
/**
|
|
46
|
+
* @default undefined
|
|
47
|
+
*/
|
|
48
|
+
paddingInlineStart?: Spacing;
|
|
49
|
+
/**
|
|
50
|
+
* @default undefined
|
|
51
|
+
*/
|
|
52
|
+
paddingInlineEnd?: Spacing;
|
|
53
|
+
/**
|
|
54
|
+
* @default undefined
|
|
55
|
+
*/
|
|
56
|
+
borderRadius?: Radius;
|
|
57
|
+
children?: React.ReactNode;
|
|
58
|
+
};
|
|
59
|
+
export type BoxProps<T extends CustomElementType> = Omit<ComponentPropsWithoutRef<T>, 'as'> & BaseBoxProps<T>;
|
|
60
|
+
type BoxComponent = <T extends CustomElementType>(props: BoxProps<T>) => React.ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* Box is a general-purpose container that allows for controlled use of design tokens.
|
|
63
|
+
* Use the given props to configure display behavior and styling that aligns with Needle's tokens.
|
|
64
|
+
*/
|
|
65
|
+
export declare const Box: BoxComponent;
|
|
66
|
+
export {};
|