@neo4j-ndl/react 0.3.1 → 0.4.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/lib/cjs/{input/Input.js → _common/input/RadioAndCheckboxWrapper.js} +6 -6
- package/lib/cjs/_common/input/RadioAndCheckboxWrapper.js.map +1 -0
- package/lib/cjs/_common/input/types.js +3 -0
- package/lib/cjs/_common/input/types.js.map +1 -0
- package/lib/cjs/_common/utilts.js +31 -0
- package/lib/cjs/_common/utilts.js.map +1 -0
- package/lib/cjs/button/Button.js +4 -8
- package/lib/cjs/button/Button.js.map +1 -1
- package/lib/cjs/button/IconButton.js +85 -0
- package/lib/cjs/button/IconButton.js.map +1 -0
- package/lib/cjs/button/IconButtonArray.js +52 -0
- package/lib/cjs/button/IconButtonArray.js.map +1 -0
- package/lib/cjs/button/index.js +2 -0
- package/lib/cjs/button/index.js.map +1 -1
- package/lib/cjs/checkbox/Checkbox.js +2 -2
- package/lib/cjs/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/radio/Radio.js +2 -2
- package/lib/cjs/radio/Radio.js.map +1 -1
- package/lib/cjs/switch/Switch.js +2 -2
- package/lib/cjs/switch/Switch.js.map +1 -1
- package/lib/cjs/table/Table.js +5 -5
- package/lib/cjs/table/Table.js.map +1 -1
- package/lib/cjs/text-input/TextInput.js +72 -0
- package/lib/cjs/text-input/TextInput.js.map +1 -0
- package/lib/cjs/{input → text-input}/index.js +3 -3
- package/lib/cjs/text-input/index.js.map +1 -0
- package/lib/esm/{input/Input.js → _common/input/RadioAndCheckboxWrapper.js} +6 -6
- package/lib/esm/_common/input/RadioAndCheckboxWrapper.js.map +1 -0
- package/lib/esm/_common/input/types.js +2 -0
- package/lib/esm/_common/input/types.js.map +1 -0
- package/lib/esm/_common/utilts.js +25 -0
- package/lib/esm/_common/utilts.js.map +1 -0
- package/lib/esm/button/Button.js +2 -4
- package/lib/esm/button/Button.js.map +1 -1
- package/lib/esm/button/IconButton.js +79 -0
- package/lib/esm/button/IconButton.js.map +1 -0
- package/lib/esm/button/IconButtonArray.js +46 -0
- package/lib/esm/button/IconButtonArray.js.map +1 -0
- package/lib/esm/button/index.js +2 -0
- package/lib/esm/button/index.js.map +1 -1
- package/lib/esm/checkbox/Checkbox.js +2 -2
- package/lib/esm/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/radio/Radio.js +2 -2
- package/lib/esm/radio/Radio.js.map +1 -1
- package/lib/esm/switch/Switch.js +2 -2
- package/lib/esm/switch/Switch.js.map +1 -1
- package/lib/esm/table/Table.js +5 -5
- package/lib/esm/table/Table.js.map +1 -1
- package/lib/esm/text-input/TextInput.js +67 -0
- package/lib/esm/text-input/TextInput.js.map +1 -0
- package/lib/esm/{input → text-input}/index.js +1 -1
- package/lib/esm/text-input/index.js.map +1 -0
- package/lib/types/_common/input/RadioAndCheckboxWrapper.d.ts +37 -0
- package/lib/types/_common/input/types.d.ts +31 -0
- package/lib/types/_common/utilts.d.ts +24 -0
- package/lib/types/button/Button.d.ts +1 -4
- package/lib/types/button/IconButton.d.ts +47 -0
- package/lib/types/button/IconButtonArray.d.ts +37 -0
- package/lib/types/button/index.d.ts +2 -0
- package/lib/types/checkbox/Checkbox.d.ts +2 -2
- package/lib/types/index.d.ts +1 -0
- package/lib/types/radio/Radio.d.ts +2 -2
- package/lib/types/switch/Switch.d.ts +2 -2
- package/lib/types/table/Table.d.ts +1 -8
- package/lib/types/text-input/TextInput.d.ts +55 -0
- package/lib/types/{input → text-input}/index.d.ts +1 -1
- package/package.json +2 -2
- package/lib/cjs/input/Input.js.map +0 -1
- package/lib/cjs/input/index.js.map +0 -1
- package/lib/esm/input/Input.js.map +0 -1
- package/lib/esm/input/index.js.map +0 -1
- package/lib/types/input/Input.d.ts +0 -44
package/lib/esm/button/Button.js
CHANGED
|
@@ -33,11 +33,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
33
33
|
import React from 'react';
|
|
34
34
|
import classnames from 'classnames';
|
|
35
35
|
import { LoadingSpinner } from '../loading-spinner';
|
|
36
|
-
|
|
37
|
-
/** Remove extra spaces from sting */
|
|
38
|
-
export const removeSpaces = (input) => input.replace(/\s+/g, ' ').trim();
|
|
36
|
+
import { removeNewlines, removeSpaces } from '../_common/utilts';
|
|
39
37
|
export const Button = React.forwardRef(function Button(_a, ref) {
|
|
40
|
-
var { children, as, type = 'button', loading = false, color = 'primary', disabled = false, fill = 'filled', rectangle = false, buttonSize = '
|
|
38
|
+
var { children, as, type = 'button', loading = false, color = 'primary', disabled = false, fill = 'filled', rectangle = false, buttonSize = 'medium', className, onClick, floating = false, tabIndex = 0 } = _a, props = __rest(_a, ["children", "as", "type", "loading", "color", "disabled", "fill", "rectangle", "buttonSize", "className", "onClick", "floating", "tabIndex"]);
|
|
41
39
|
let Component = as || 'button';
|
|
42
40
|
if (!as && props.href) {
|
|
43
41
|
Component = 'a';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,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O,CAAC,CAAC,CAAC,CACT,KAAC,cAAc,IAAC,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,OAAO,GAAG,CAC7D,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,KACC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 React from 'react';
|
|
34
|
+
import classnames from 'classnames';
|
|
35
|
+
import { LoadingSpinner } from '../loading-spinner';
|
|
36
|
+
import { needleWarningMessage } from '../_common/utilts';
|
|
37
|
+
export const IconButton = React.forwardRef(function Button(_a, ref) {
|
|
38
|
+
var { children, as, type = 'button', loading = false, disabled = false, buttonSize = 'medium', className, onClick, grouped, floating = false, danger, clean } = _a, props = __rest(_a, ["children", "as", "type", "loading", "disabled", "buttonSize", "className", "onClick", "grouped", "floating", "danger", "clean"]);
|
|
39
|
+
let Component = as || 'button';
|
|
40
|
+
if (!as && props.href) {
|
|
41
|
+
Component = 'a';
|
|
42
|
+
}
|
|
43
|
+
const interactable = !disabled && !loading;
|
|
44
|
+
const classes = classnames(`ndl-icon-btn ${buttonSize} ${className}`, {
|
|
45
|
+
grouped,
|
|
46
|
+
disabled,
|
|
47
|
+
loading,
|
|
48
|
+
floating,
|
|
49
|
+
danger,
|
|
50
|
+
clean,
|
|
51
|
+
});
|
|
52
|
+
if (clean && floating) {
|
|
53
|
+
needleWarningMessage("Can't have 'clean' and 'floating' props true at the same time");
|
|
54
|
+
}
|
|
55
|
+
if (!props['aria-label']) {
|
|
56
|
+
needleWarningMessage('Icon buttons do not have text, be sure to include one for screen readers link: https://dequeuniversity.com/rules/axe/4.4/button-name?application=axeAPI');
|
|
57
|
+
}
|
|
58
|
+
const handleClick = (e) => {
|
|
59
|
+
if (!interactable) {
|
|
60
|
+
// By default, a <button /> element with disabled set to true will not get its
|
|
61
|
+
// on click handler called. To support the same behavior on <a /> tags we
|
|
62
|
+
// swallow the event here when disabled, since the <a /> tag with disabled set to
|
|
63
|
+
// true will have its onClick handler called
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
e.stopPropagation();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (onClick) {
|
|
69
|
+
onClick(e);
|
|
70
|
+
}
|
|
71
|
+
else if (!props.href) {
|
|
72
|
+
console.error('onClick was not provided');
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return (_jsx(Component
|
|
76
|
+
/** First props and then className to avoid overriding in classNames */
|
|
77
|
+
, Object.assign({}, props, (Component === 'button' ? { type } : {}), { onClick: handleClick, disabled: !interactable, className: classes, ref: ref }, { children: _jsx("div", Object.assign({ className: "ndl-icon" }, { children: loading ? (_jsx(LoadingSpinner, { className: "n-my-auto n-mr-1", size: "small" })) : (children) })) })));
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=IconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../src/button/IconButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAmCzD,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,MAAM,CACxD,EAckB,EAClB,GAAG;QAfH,EACE,QAAQ,EACR,EAAE,EACF,IAAI,GAAG,QAAQ,EACf,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,UAAU,GAAG,QAAQ,EACrB,SAAS,EACT,OAAO,EACP,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,MAAM,EACN,KAAK,OAEW,EADb,KAAK,cAbV,iIAcC,CADS;IAIV,IAAI,SAAS,GAAG,EAAE,IAAI,QAAQ,CAAC;IAE/B,IAAI,CAAC,EAAE,IAAI,KAAK,CAAC,IAAI,EAAE;QACrB,SAAS,GAAG,GAAG,CAAC;KACjB;IAED,MAAM,YAAY,GAAG,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC;IAE3C,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAg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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 React from 'react';
|
|
34
|
+
import classnames from 'classnames';
|
|
35
|
+
export const IconButtonArray = React.forwardRef(function Button(_a, ref) {
|
|
36
|
+
var { children, as, className, floating = false, orientation = 'horizontal' } = _a, props = __rest(_a, ["children", "as", "className", "floating", "orientation"]);
|
|
37
|
+
const Component = as || 'div';
|
|
38
|
+
const classes = classnames(`ndl-icon-btn-array`, {
|
|
39
|
+
'n-flex-row': orientation === 'horizontal',
|
|
40
|
+
'n-flex-col': orientation === 'vertical',
|
|
41
|
+
'array-floating': floating,
|
|
42
|
+
[`${className}`]: className,
|
|
43
|
+
});
|
|
44
|
+
return (_jsx(Component, Object.assign({}, props, { className: classes, ref: ref }, { children: children })));
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=IconButtonArray.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButtonArray.js","sourceRoot":"","sources":["../../../src/button/IconButtonArray.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AAqBpC,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,MAAM,CAC7D,EAOuB,EACvB,GAAG;QARH,EACE,QAAQ,EACR,EAAE,EACF,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,WAAW,GAAG,YAAY,OAEL,EADlB,KAAK,cANV,0DAOC,CADS;IAIV,MAAM,SAAS,GAAG,EAAE,IAAI,KAAK,CAAC;IAE9B,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,EAAE;QAC/C,YAAY,EAAE,WAAW,KAAK,YAAY;QAC1C,YAAY,EAAE,WAAW,KAAK,UAAU;QACxC,gBAAgB,EAAE,QAAQ;QAC1B,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,SAAS;KAC5B,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,SAAS,oBAAK,KAAK,IAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,gBAC/C,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/lib/esm/button/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
@@ -20,7 +20,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
22
|
import React from 'react';
|
|
23
|
-
import
|
|
23
|
+
import RadioAndCheckboxWrapper from '../_common/input/RadioAndCheckboxWrapper';
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
26
26
|
*
|
|
@@ -40,7 +40,7 @@ const Checkbox = React.forwardRef((props, ref) => {
|
|
|
40
40
|
if (!props['aria-label'] && !props.label) {
|
|
41
41
|
console.warn('To be accesible the input component requires either `aria-label` or `label` prop: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI');
|
|
42
42
|
}
|
|
43
|
-
return _jsx(
|
|
43
|
+
return (_jsx(RadioAndCheckboxWrapper, Object.assign({}, props, { ref: ref, type: "checkbox", role: "checkbox" })));
|
|
44
44
|
});
|
|
45
45
|
Checkbox.displayName = 'Checkbox';
|
|
46
46
|
export default Checkbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/checkbox/Checkbox.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/checkbox/Checkbox.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,uBAEN,MAAM,0CAA0C,CAAC;AAElD;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CAAC,KAA4B,EAAE,GAAyC,EAAE,EAAE;IAC1E,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;QACxC,OAAO,CAAC,IAAI,CACV,sJAAsJ,CACvJ,CAAC;KACH;IAED,OAAO,CACL,KAAC,uBAAuB,oBAClB,KAAK,IACT,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,UAAU,IACf,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,eAAe,QAAQ,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,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
package/lib/esm/radio/Radio.js
CHANGED
|
@@ -20,7 +20,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
22
|
import React from 'react';
|
|
23
|
-
import
|
|
23
|
+
import RadioAndCheckboxWrapper from '../_common/input/RadioAndCheckboxWrapper';
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
26
26
|
*
|
|
@@ -37,7 +37,7 @@ import { Input } from '../input';
|
|
|
37
37
|
*
|
|
38
38
|
*/
|
|
39
39
|
const Radio = React.forwardRef(function Radio(props, ref) {
|
|
40
|
-
return _jsx(
|
|
40
|
+
return (_jsx(RadioAndCheckboxWrapper, Object.assign({}, props, { type: "radio", role: "radio", ref: ref })));
|
|
41
41
|
});
|
|
42
42
|
export default Radio;
|
|
43
43
|
//# sourceMappingURL=Radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../src/radio/Radio.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../src/radio/Radio.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,uBAEN,MAAM,0CAA0C,CAAC;AAElD;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,KAAK,CAC3C,KAA4B,EAC5B,GAAyC;IAEzC,OAAO,CACL,KAAC,uBAAuB,oBAAK,KAAK,IAAE,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,GAAG,EAAE,GAAG,IAAI,CAC3E,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
package/lib/esm/switch/Switch.js
CHANGED
|
@@ -20,7 +20,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
20
20
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
22
|
import React from 'react';
|
|
23
|
-
import
|
|
23
|
+
import RadioAndCheckboxWrapper from '../_common/input/RadioAndCheckboxWrapper';
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
26
26
|
*
|
|
@@ -37,7 +37,7 @@ import { Input } from '../input';
|
|
|
37
37
|
*
|
|
38
38
|
*/
|
|
39
39
|
const Switch = React.forwardRef(function Switch(props, ref) {
|
|
40
|
-
return _jsx(
|
|
40
|
+
return (_jsx(RadioAndCheckboxWrapper, Object.assign({}, props, { ref: ref, type: "checkbox", role: "switch" })));
|
|
41
41
|
});
|
|
42
42
|
export default Switch;
|
|
43
43
|
//# sourceMappingURL=Switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/switch/Switch.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/switch/Switch.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,uBAEN,MAAM,0CAA0C,CAAC;AAElD;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,MAAM,CAC7C,KAA4B,EAC5B,GAAyC;IAEzC,OAAO,CACL,KAAC,uBAAuB,oBAClB,KAAK,IACT,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,QAAQ,IACb,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
package/lib/esm/table/Table.js
CHANGED
|
@@ -57,7 +57,7 @@ const DefaultHeader = ({ headerGroups, }) => (_jsx("thead", { children:
|
|
|
57
57
|
// Apply the header cell props
|
|
58
58
|
// Key is defined from getHeaderGroupProps so we can ignore the false-negative
|
|
59
59
|
// eslint-disable-next-line react/jsx-key
|
|
60
|
-
_jsxs("th", Object.assign({ style: Object.assign(Object.assign({}, castedColumn.getHeaderProps().style), {
|
|
60
|
+
_jsxs("th", Object.assign({}, castedColumn.getHeaderProps(), { style: Object.assign(Object.assign({}, castedColumn.getHeaderProps().style), {
|
|
61
61
|
/** 0.25px */
|
|
62
62
|
letterSpacing: '0.25px' }), scope: "col", className: headerClasses }, { children: [_jsxs("div", Object.assign({ className: "table-header-cell" }, { children: [castedColumn.render('Header'), castedColumn.canSort && (_jsx(SortIcon, Object.assign({}, castedColumn.getSortByToggleProps(), { isSortedDesc: castedColumn.isSortedDesc })))] })), 'canResize' in castedColumn &&
|
|
63
63
|
'getResizerProps' in castedColumn && (_jsx(ResizingBar, Object.assign({}, castedColumn.getResizerProps())))] })));
|
|
@@ -71,10 +71,10 @@ const DefaultBody = ({ getTableBodyProps, page, prepareRow, actionsButtons, rows
|
|
|
71
71
|
return (
|
|
72
72
|
// Key is defined from getHeaderGroupProps so we can ignore the false-negative
|
|
73
73
|
// eslint-disable-next-line react/jsx-key
|
|
74
|
-
_jsxs("tr", Object.assign({ className: "table-row" }, row.getRowProps(), { children: [row.cells.map((cell) => (
|
|
74
|
+
_jsxs("tr", Object.assign({ className: "ndl-table-row" }, row.getRowProps(), { children: [row.cells.map((cell) => (
|
|
75
75
|
// Key is defined from getHeaderGroupProps so we can ignore the false-negative
|
|
76
76
|
// eslint-disable-next-line react/jsx-key
|
|
77
|
-
_jsx("td", Object.assign({ className: "table-cell" }, cell.getCellProps(), { children: cell.render('Cell') })))), actionsButtons && actionsButtons(row)] })));
|
|
77
|
+
_jsx("td", Object.assign({ className: "ndl-table-cell" }, cell.getCellProps(), { children: cell.render('Cell') })))), actionsButtons && actionsButtons(row)] })));
|
|
78
78
|
}) }))) : (_jsx("tr", { children: _jsx("h6", Object.assign({ className: "n-my-5 n-w-full n-text-center n-h-10 n-relative n-left-full n-flex n-justify-center n-items-center" }, { children: "No data present" })) })) }));
|
|
79
79
|
};
|
|
80
80
|
const DefaultNavigation = ({ state, rows, page, canPreviousPage, nextPage, pageOptions, pageCount, gotoPage, canNextPage, previousPage, setPageSize, }) => {
|
|
@@ -107,11 +107,11 @@ const DefaultNavigation = ({ state, rows, page, canPreviousPage, nextPage, pageO
|
|
|
107
107
|
const Table = (props
|
|
108
108
|
// props: any
|
|
109
109
|
) => {
|
|
110
|
-
const { controls, getTableProps, header, body, navigation,
|
|
110
|
+
const { controls, getTableProps, header, body, navigation, className = '', style = {}, role, } = props;
|
|
111
111
|
if (!getTableProps) {
|
|
112
112
|
throw new Error('getTableProps is required');
|
|
113
113
|
}
|
|
114
|
-
return (_jsxs("div", Object.assign({ className: classNames('ndl-table n-
|
|
114
|
+
return (_jsxs("div", Object.assign({ className: classNames('ndl-table n-overflow-hidden n-flex n-flex-col n-divide-y n-divide-light-neutral-border-weak n-bg-light-neutral-bg-weak n-shadow-l3', className), style: style, role: role }, { children: [controls && (_jsx("div", Object.assign({ className: "n-px-7 n-py-6 n-flex n-flex-row n-items-center" }, { children: controls }))), _jsx("div", Object.assign({ className: "n-overflow-x-auto" }, { children: _jsxs("table", Object.assign({}, getTableProps(), { className: "n-w-full n-min-w-full n-divide-y n-divide-light-neutral-border-weak n-bg-light-neutral-bg-weak" }, { children: [header || _jsx(DefaultHeader, Object.assign({}, props)), body || _jsx(DefaultBody, Object.assign({}, props))] })) })), navigation || (_jsx(DefaultNavigation, Object.assign({}, props)))] })));
|
|
115
115
|
};
|
|
116
116
|
export default Table;
|
|
117
117
|
//# sourceMappingURL=Table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../src/table/Table.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AAiBpC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAGhD,sEAAsE;AACtE,MAAM,aAAa,GAAG;IACpB,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;CACjB,CAAC;AAOX;;;;;GAKG;AAEH,oEAAoE;AACpE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,MAAc,EAAE,EAAE,CAAC,CAAC;IAC7D,KAAK,EAAE,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,KAAK,IAAI,EAAE;CACzC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../src/table/Table.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AAiBpC,OAAO,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
|
+
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
|
+
import React from 'react';
|
|
34
|
+
import classNames from 'classnames';
|
|
35
|
+
import { HeroIcon } from '../icons';
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
*
|
|
39
|
+
* Helpers
|
|
40
|
+
*
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
/** Add any helper functions here. */
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
*
|
|
47
|
+
* TextInput Component
|
|
48
|
+
*
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
const TextInput = React.forwardRef(function TextInput(props, ref) {
|
|
52
|
+
const { label, fluid, errorText, helpText, leftIcon, rightIcon, type = 'text', containerSize = 'small' } = props, otherInputProps = __rest(props, ["label", "fluid", "errorText", "helpText", "leftIcon", "rightIcon", "type", "containerSize"]);
|
|
53
|
+
const containerWrappingClass = classNames(`ndl-form-item ndl-type-text`, {
|
|
54
|
+
disabled: otherInputProps.disabled,
|
|
55
|
+
[containerSize]: containerSize,
|
|
56
|
+
'has-error': errorText,
|
|
57
|
+
'has-left-icon': leftIcon,
|
|
58
|
+
'has-right-icon': rightIcon || errorText,
|
|
59
|
+
'has-icon': leftIcon || rightIcon || errorText,
|
|
60
|
+
});
|
|
61
|
+
const labelWrappingClass = classNames(`form-item-label`, {
|
|
62
|
+
fluid,
|
|
63
|
+
});
|
|
64
|
+
return (_jsxs("div", Object.assign({ className: containerWrappingClass }, { children: [_jsxs("label", Object.assign({ className: labelWrappingClass }, { children: [_jsxs("div", Object.assign({ className: "input-wrapper" }, { children: [leftIcon && _jsx("div", Object.assign({ className: "icon left-icon" }, { children: leftIcon })), _jsx("input", Object.assign({}, otherInputProps, { type: type, ref: ref })), rightIcon && !errorText && (_jsx("div", Object.assign({ className: "icon right-icon" }, { children: rightIcon }))), errorText && (_jsx("div", Object.assign({ className: "icon right-icon error-icon" }, { children: _jsx(HeroIcon, { iconName: "ExclamationCircleIcon", type: "solid" }) })))] })), _jsx("span", Object.assign({ className: "form-label-text" }, { children: label }))] })), (errorText || helpText) && (_jsx("div", Object.assign({ className: "form-msg" }, { children: errorText || helpText })))] })));
|
|
65
|
+
});
|
|
66
|
+
export default TextInput;
|
|
67
|
+
//# sourceMappingURL=TextInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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B,4BAAK,SAAS,EAAC,iBAAiB,gBAAE,SAAS,IAAO,CACnD,EACA,SAAS,IAAI,CACZ,4BAAK,SAAS,EAAC,4BAA4B,gBACzC,KAAC,QAAQ,IAAC,QAAQ,EAAC,uBAAuB,EAAC,IAAI,EAAC,OAAO,GAAG,IACtD,CACP,KACG,EAEN,6BAAM,SAAS,EAAC,iBAAiB,gBAAE,KAAK,IAAQ,KAC1C,EACP,CAAC,SAAS,IAAI,QAAQ,CAAC,IAAI,CAC1B,4BAAK,SAAS,EAAC,UAAU,gBAAE,SAAS,IAAI,QAAQ,IAAO,CACxD,KACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
export { default as
|
|
21
|
+
export { default as TextInput } from './TextInput';
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/text-input/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { CommonInputProps } from './types';
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
* Types
|
|
27
|
+
*
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export interface RadioAndCheckboxProps extends CommonInputProps {
|
|
31
|
+
/** Sets checked state */
|
|
32
|
+
checked?: boolean;
|
|
33
|
+
/** Displays label before */
|
|
34
|
+
labelBefore?: boolean;
|
|
35
|
+
}
|
|
36
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<RadioAndCheckboxProps, "size" | "className" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "list" | "children" | "role" | "onChange" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "placeholder" | "readOnly" | "required" | "src" | "step" | "type" | "value" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "enterKeyHint" | "labelBefore" | "fluid"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
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
|
+
export interface CommonInputProps extends React.ComponentPropsWithoutRef<'input'> {
|
|
23
|
+
/** Sets disabled state */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Sets the label */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** Displays with fluid width */
|
|
28
|
+
fluid?: boolean;
|
|
29
|
+
/** Ref to the `input` element */
|
|
30
|
+
ref?: React.RefObject<HTMLInputElement>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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 declare const removeNewlines: (input: string) => string;
|
|
22
|
+
/** Remove extra spaces from sting */
|
|
23
|
+
export declare const removeSpaces: (input: string) => string;
|
|
24
|
+
export declare const needleWarningMessage: (message: string) => void;
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
import React from 'react';
|
|
22
22
|
import { Neo4jColors } from '@neo4j-ndl/base';
|
|
23
23
|
import { ElementBase } from '../helpers';
|
|
24
|
-
export declare const removeNewlines: (input: string) => string;
|
|
25
|
-
/** Remove extra spaces from sting */
|
|
26
|
-
export declare const removeSpaces: (input: string) => string;
|
|
27
24
|
/**
|
|
28
25
|
*
|
|
29
26
|
*
|
|
@@ -44,7 +41,7 @@ export interface ButtonProps extends ElementBase<HTMLButtonElement> {
|
|
|
44
41
|
/** Fill type of button */
|
|
45
42
|
fill?: 'filled' | 'outlined' | 'text';
|
|
46
43
|
/** Size of button */
|
|
47
|
-
buttonSize?: '
|
|
44
|
+
buttonSize?: 'small' | 'medium' | 'large';
|
|
48
45
|
/** Rectanle (for icon usage mainly) */
|
|
49
46
|
rectangle?: boolean;
|
|
50
47
|
/** If the button is in floating state */
|
|
@@ -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 React from 'react';
|
|
22
|
+
import { ElementBase } from '../helpers';
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
* Types
|
|
27
|
+
*
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export interface IconButtonProps extends ElementBase<HTMLButtonElement> {
|
|
31
|
+
children: string | React.ReactNode;
|
|
32
|
+
/** If the icon button is in disabled state */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** If the button is doing something Async, it will display a loading spinner */
|
|
35
|
+
loading?: boolean;
|
|
36
|
+
/** If the button does not have a visible container */
|
|
37
|
+
clean?: boolean;
|
|
38
|
+
/** Size of button */
|
|
39
|
+
buttonSize?: 'small' | 'medium' | 'large';
|
|
40
|
+
/** If the button is in floating state */
|
|
41
|
+
floating?: boolean;
|
|
42
|
+
/** Turn the button red button */
|
|
43
|
+
danger?: boolean;
|
|
44
|
+
/** If the button is in a group, the icon's container is more compact */
|
|
45
|
+
grouped?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<unknown>>;
|