@neo4j-ndl/react 1.0.0-alpha-5a0ff3c → 1.0.0-alpha-e2de802
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/_common/input/types.js +20 -0
- package/lib/cjs/_common/input/types.js.map +1 -1
- package/lib/cjs/_common/utils.js +2 -2
- package/lib/cjs/checkbox/Checkbox.js +1 -1
- package/lib/cjs/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/dropdown/Dropdown.js +11 -34
- package/lib/cjs/dropdown/Dropdown.js.map +1 -1
- package/lib/cjs/dropdown/Overrides.js.map +1 -1
- package/lib/cjs/text-input/TextInput.js +3 -34
- package/lib/cjs/text-input/TextInput.js.map +1 -1
- package/lib/esm/_common/input/types.js +20 -0
- package/lib/esm/_common/input/types.js.map +1 -1
- package/lib/esm/_common/utils.js +2 -2
- package/lib/esm/checkbox/Checkbox.js +1 -1
- package/lib/esm/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/dropdown/Dropdown.js +11 -34
- package/lib/esm/dropdown/Dropdown.js.map +1 -1
- package/lib/esm/dropdown/Overrides.js.map +1 -1
- package/lib/esm/text-input/TextInput.js +3 -11
- package/lib/esm/text-input/TextInput.js.map +1 -1
- package/lib/types/_common/input/RadioAndCheckboxWrapper.d.ts +1 -1
- package/lib/types/_common/input/types.d.ts +2 -2
- package/lib/types/_common/utils.d.ts +1 -1
- package/lib/types/checkbox/Checkbox.d.ts +1 -1
- package/lib/types/context-menu/ContextMenu.d.ts +1 -1
- package/lib/types/dropdown/Dropdown.d.ts +2 -2
- package/lib/types/dropdown/Overrides.d.ts +5 -5
- package/lib/types/dropdown/types.d.ts +20 -23
- package/lib/types/radio/Radio.d.ts +1 -1
- package/lib/types/switch/Switch.d.ts +1 -1
- package/lib/types/text-input/TextInput.d.ts +4 -12
- package/package.json +2 -2
|
@@ -1,3 +1,23 @@
|
|
|
1
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
|
+
*/
|
|
2
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
23
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/_common/input/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/_common/input/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
|
package/lib/cjs/_common/utils.js
CHANGED
|
@@ -83,8 +83,8 @@ exports.useOnClickOutside = useOnClickOutside;
|
|
|
83
83
|
/**
|
|
84
84
|
* X - char long pseudo-random string
|
|
85
85
|
*/
|
|
86
|
-
const randomId = (
|
|
86
|
+
const randomId = (length) => Math.random()
|
|
87
87
|
.toString(36)
|
|
88
|
-
.slice(2,
|
|
88
|
+
.slice(2, length + 2);
|
|
89
89
|
exports.randomId = randomId;
|
|
90
90
|
//# sourceMappingURL=utils.js.map
|
|
@@ -43,7 +43,7 @@ const RadioAndCheckboxWrapper_1 = __importDefault(require("../_common/input/Radi
|
|
|
43
43
|
*/
|
|
44
44
|
const Checkbox = react_1.default.forwardRef((props, ref) => {
|
|
45
45
|
if (!props['aria-label'] && !props.label) {
|
|
46
|
-
console.warn('To be
|
|
46
|
+
console.warn('To be accessible the input component requires either `aria-label` or `label` prop: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI');
|
|
47
47
|
}
|
|
48
48
|
return ((0, jsx_runtime_1.jsx)(RadioAndCheckboxWrapper_1.default, Object.assign({}, props, { ref: ref, type: "checkbox", role: "checkbox" })));
|
|
49
49
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,uGAEkD;AAElD;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,QAAQ,GAAG,eAAK,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,
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,uGAEkD;AAElD;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,QAAQ,GAAG,eAAK,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,uJAAuJ,CACxJ,CAAC;KACH;IAED,OAAO,CACL,uBAAC,iCAAuB,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,kBAAe,QAAQ,CAAC"}
|
|
@@ -105,33 +105,9 @@ const customStyles = ({ errorText, size, }) => {
|
|
|
105
105
|
placeholder: (provided) => (Object.assign(Object.assign({}, provided), { color: base_1.tokens.palette.light.neutral.text.weaker })),
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
|
-
const ExposedKeys = [
|
|
109
|
-
'onChange',
|
|
110
|
-
'isMulti',
|
|
111
|
-
'isClearable',
|
|
112
|
-
'formatOptionLabel',
|
|
113
|
-
'value',
|
|
114
|
-
'placeholder',
|
|
115
|
-
'options',
|
|
116
|
-
];
|
|
117
108
|
exports.Dropdown = (0, helpers_1.forwardRef)(function Dropdown(props, ref) {
|
|
118
|
-
const { as, label, helpText, errorText, fluid = true, size = 'small', type = 'select',
|
|
109
|
+
const { as, label, helpText, errorText, fluid = true, size = 'small', type = 'select', 'aria-label': ariaLabel, selectProps = {} } = props, rest = __rest(props, ["as", "label", "helpText", "errorText", "fluid", "size", "type", 'aria-label', "selectProps"]);
|
|
119
110
|
const Component = as || 'div';
|
|
120
|
-
/**
|
|
121
|
-
* Merge selectProps with exposed react-select props
|
|
122
|
-
* Priority is given to selectProps
|
|
123
|
-
* Source: https://stackoverflow.com/a/32184094/3247715
|
|
124
|
-
*/
|
|
125
|
-
const MergedSelectProps = (0, react_1.useMemo)(() => ExposedKeys.reduce((a, e) => ((a[e] = selectProps[e] || rest[e]), a), selectProps), [rest, selectProps]);
|
|
126
|
-
/**
|
|
127
|
-
* Remove selectProps from rest
|
|
128
|
-
* to spread them in the root component
|
|
129
|
-
*/
|
|
130
|
-
const RestProps = (0, react_1.useMemo)(() => {
|
|
131
|
-
const cloned = Object.assign({}, rest);
|
|
132
|
-
ExposedKeys.forEach((key) => delete cloned[key]);
|
|
133
|
-
return cloned;
|
|
134
|
-
}, [rest]);
|
|
135
111
|
const ComponentOverrides = (0, react_1.useMemo)(() => overrideComponents({ errorText, size }), [errorText, size]);
|
|
136
112
|
const StyleOverrides = (0, react_1.useMemo)(() => customStyles({ errorText, size }), [errorText, size]);
|
|
137
113
|
const identifier = (0, react_1.useMemo)(() => {
|
|
@@ -145,20 +121,21 @@ exports.Dropdown = (0, helpers_1.forwardRef)(function Dropdown(props, ref) {
|
|
|
145
121
|
}, [label, ariaLabel]);
|
|
146
122
|
let SelectElement;
|
|
147
123
|
switch (type) {
|
|
148
|
-
case 'async
|
|
149
|
-
SelectElement = ((0, jsx_runtime_1.jsx)(async_1.default, Object.assign({ name: identifier, inputId: identifier },
|
|
124
|
+
case 'async': {
|
|
125
|
+
SelectElement = ((0, jsx_runtime_1.jsx)(async_1.default, Object.assign({ name: identifier, inputId: identifier }, selectProps, { styles: Object.assign(Object.assign({}, StyleOverrides), selectProps.styles), components: Object.assign(Object.assign({}, ComponentOverrides), selectProps.components) })));
|
|
150
126
|
break;
|
|
151
127
|
}
|
|
152
128
|
case 'creatable':
|
|
153
|
-
SelectElement = ((0, jsx_runtime_1.jsx)(creatable_1.default, Object.assign({ name: identifier, inputId: identifier },
|
|
129
|
+
SelectElement = ((0, jsx_runtime_1.jsx)(creatable_1.default, Object.assign({ name: identifier, inputId: identifier }, selectProps, { styles: Object.assign(Object.assign({}, StyleOverrides), selectProps.styles), components: Object.assign(Object.assign({}, ComponentOverrides), selectProps.components) })));
|
|
154
130
|
break;
|
|
155
131
|
default:
|
|
156
|
-
SelectElement = ((0, jsx_runtime_1.jsx)(react_select_1.default, Object.assign({ name: identifier, inputId: identifier },
|
|
132
|
+
SelectElement = ((0, jsx_runtime_1.jsx)(react_select_1.default, Object.assign({ name: identifier, inputId: identifier }, selectProps, { styles: Object.assign(Object.assign({}, StyleOverrides), selectProps.styles), components: Object.assign(Object.assign({}, ComponentOverrides), selectProps.components) })));
|
|
157
133
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
134
|
+
const classNames = (0, classnames_1.default)('ndl-dropdown', props.className, {
|
|
135
|
+
'ndl-small': size === 'small',
|
|
136
|
+
'ndl-large': size === 'large',
|
|
137
|
+
'ndl-fluid': fluid,
|
|
138
|
+
});
|
|
139
|
+
return ((0, jsx_runtime_1.jsxs)(Component, Object.assign({}, rest, { "aria-label": ariaLabel, ref: ref, className: classNames }, { children: [label && (0, jsx_runtime_1.jsx)("label", Object.assign({ htmlFor: identifier }, { children: label })), SelectElement, helpText && !errorText && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "ndl-sub-text" }, { children: helpText }))), errorText && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "ndl-sub-text ndl-error-text" }, { children: errorText })))] })));
|
|
163
140
|
});
|
|
164
141
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../src/dropdown/Dropdown.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iCAAuC;AACvC,4DAAoC;AACpC,0CAAyC;AAEzC,2CAA2C;AAC3C,gEAAiD;AACjD,uEAA+C;AAC/C,+DAA6C;AAE7C,wCAAwC;AACxC,4CAAwD;
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../src/dropdown/Dropdown.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iCAAuC;AACvC,4DAAoC;AACpC,0CAAyC;AAEzC,2CAA2C;AAC3C,gEAAiD;AACjD,uEAA+C;AAC/C,+DAA6C;AAE7C,wCAAwC;AACxC,4CAAwD;AAExD,2CAKqB;AAErB;;;;;;GAMG;AAEH,MAAM,kBAAkB,GAAG,CAKzB,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M,GAClD,UAAU,kCAAO,kBAAkB,GAAK,WAAW,CAAC,UAAU,KAC9D,CACH,CAAC;YACF,MAAM;QACR;YACE,aAAa,GAAG,CACd,uBAAC,sBAAM,kBACL,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,UAAU,IACf,WAAW,IACf,MAAM,kCAAO,cAAc,GAAK,WAAW,CAAC,MAAM,GAClD,UAAU,kCAAO,kBAAkB,GAAK,WAAW,CAAC,UAAU,KAC9D,CACH,CAAC;KACL;IAED,MAAM,UAAU,GAAG,IAAA,oBAAU,EAAC,cAAc,EAAE,KAAK,CAAC,SAAS,EAAE;QAC7D,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;IAEH,OAAO,CACL,wBAAC,SAAS,oBACJ,IAAI,kBACI,SAAS,EACrB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,iBAEpB,KAAK,IAAI,gDAAO,OAAO,EAAE,UAAU,gBAAG,KAAK,IAAS,EACpD,aAAa,EACb,QAAQ,IAAI,CAAC,SAAS,IAAI,CACzB,+CAAM,SAAS,EAAC,cAAc,gBAAE,QAAQ,IAAQ,CACjD,EACA,SAAS,IAAI,CACZ,+CAAM,SAAS,EAAC,6BAA6B,gBAAE,SAAS,IAAQ,CACjE,KACS,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overrides.js","sourceRoot":"","sources":["../../../src/dropdown/Overrides.tsx"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,0CAAyC;AACzC,4DAAoC;AACpC,+CAOsB;AACtB,oCAIkB;AAGX,MAAM,yBAAyB,GAAG,CAIvC,EACA,SAAS,EACT,IAAI,
|
|
1
|
+
{"version":3,"file":"Overrides.js","sourceRoot":"","sources":["../../../src/dropdown/Overrides.tsx"],"names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AK,SAAS,EAAC,eAAe,GAAG,KAC7B,IACoB,CAC7B,CAAC;AACJ,CAAC,CAAC;AAnBS,QAAA,qBAAqB,yBAmB9B;AAEG,MAAM,sBAAsB,GAAG,CAIpC,EACA,SAAS,EACT,IAAI,GACwD,EAAE,EAAE,CAChE,SAAS,SAAS,CAChB,KAA4D;IAE5D,OAAO,CACL,uBAAC,yBAAU,CAAC,gBAAgB,oBAAK,KAAK,cACpC,uBAAC,wBAAgB,IACf,SAAS,EAAC,gCAAgC,EAC1C,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;aAC3C,GACD,IAC0B,CAC/B,CAAC;AACJ,CAAC,CAAC;AArBS,QAAA,sBAAsB,0BAqB/B;AAEG,MAAM,iBAAiB,GAAG,CAI/B,EACA,SAAS,EACT,IAAI,GACwD,EAAE,EAAE,CAChE,SAAS,SAAS,CAAC,KAAuD;IACxE,OAAO,CACL,uBAAC,yBAAU,CAAC,WAAW,oBAAK,KAAK,cAC/B,8CAAK,SAAS,EAAC,sDAAsD,gBAClE,KAAK,CAAC,QAAQ,IACX,IACiB,CAC1B,CAAC;AACJ,CAAC,CAAC;AAhBS,QAAA,iBAAiB,qBAgB1B"}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -58,18 +35,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
58
35
|
* You should have received a copy of the GNU General Public License
|
|
59
36
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
60
37
|
*/
|
|
61
|
-
const react_1 =
|
|
38
|
+
const react_1 = require("react");
|
|
62
39
|
const classnames_1 = __importDefault(require("classnames"));
|
|
63
40
|
const icons_1 = require("../icons");
|
|
64
41
|
const utils_1 = require("../_common/utils");
|
|
65
|
-
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* Helpers
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*/
|
|
72
|
-
/** Add any helper functions here. */
|
|
73
42
|
/**
|
|
74
43
|
*
|
|
75
44
|
*
|
|
@@ -77,7 +46,7 @@ const utils_1 = require("../_common/utils");
|
|
|
77
46
|
*
|
|
78
47
|
*
|
|
79
48
|
*/
|
|
80
|
-
const TextInput = react_1.
|
|
49
|
+
const TextInput = (0, react_1.forwardRef)(function TextInput(props, ref) {
|
|
81
50
|
const { label, fluid, errorText, helpText, leftIcon, rightIcon, type = 'text', containerSize = 'small', 'aria-label': ariaLabel } = props, customProps = __rest(props, ["label", "fluid", "errorText", "helpText", "leftIcon", "rightIcon", "type", "containerSize", 'aria-label']);
|
|
82
51
|
const containerWrappingClass = (0, classnames_1.default)(`ndl-form-item ndl-type-text`, customProps.className, {
|
|
83
52
|
'ndl-disabled': customProps.disabled,
|
|
@@ -99,7 +68,7 @@ const TextInput = react_1.default.forwardRef(function TextInput(props, ref) {
|
|
|
99
68
|
}
|
|
100
69
|
}, [label, ariaLabel]);
|
|
101
70
|
const customPropsClassNameStripped = Object.assign(Object.assign({}, customProps), { className: undefined });
|
|
102
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: containerWrappingClass }, { children: [(0, jsx_runtime_1.jsxs)("label", Object.assign({ className: labelWrappingClass }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "ndl-input-wrapper" }, { children: [leftIcon && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-icon ndl-left-icon" }, { children: leftIcon })), (0, jsx_runtime_1.jsx)("input", Object.assign({}, customPropsClassNameStripped, { type: type, ref: ref, "aria-label": ariaLabel })), rightIcon && !errorText && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-right-icon" }, { children: rightIcon })))] })), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "ndl-form-label-text" }, { children: label }))] })), helpText && !errorText && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-form-msg" }, { children: helpText })), errorText && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "ndl-form-msg" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-error-icon" }, { children: (0, jsx_runtime_1.jsx)(icons_1.ExclamationCircleIconSolid, {}) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-error-text" }, { children: errorText }))] })))] })));
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: containerWrappingClass }, { children: [(0, jsx_runtime_1.jsxs)("label", Object.assign({ className: labelWrappingClass }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "ndl-input-wrapper" }, { children: [leftIcon && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-icon ndl-left-icon" }, { children: leftIcon })), (0, jsx_runtime_1.jsx)("input", Object.assign({}, customPropsClassNameStripped, { type: type, ref: ref, "aria-label": ariaLabel })), rightIcon && !errorText && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-icon ndl-right-icon" }, { children: rightIcon })))] })), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "ndl-form-label-text" }, { children: label }))] })), helpText && !errorText && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-form-msg" }, { children: helpText })), errorText && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "ndl-form-msg" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-error-icon" }, { children: (0, jsx_runtime_1.jsx)(icons_1.ExclamationCircleIconSolid, {}) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-error-text" }, { children: errorText }))] })))] })));
|
|
103
72
|
});
|
|
104
73
|
exports.default = TextInput;
|
|
105
74
|
//# sourceMappingURL=TextInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/text-input/TextInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/text-input/TextInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iCAA4C;AAC5C,4DAAoC;AAEpC,oCAAsD;AACtD,4CAAwD;AA2BxD;;;;;;GAMG;AAEH,MAAM,SAAS,GAAG,IAAA,kBAAU,EAAC,SAAS,SAAS,CAC7C,KAA0B,EAC1B,GAAmC;IAEnC,MAAM,EACJ,KAAK,EACL,KAAK,EACL,SAA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,EAAE,GAAG,gBACI,SAAS,IACrB,EACD,SAAS,IAAI,CAAC,SAAS,IAAI,CAC1B,8CAAK,SAAS,EAAC,yBAAyB,gBAAE,SAAS,IAAO,CAC3D,KACG,EAEN,+CAAM,SAAS,EAAC,qBAAqB,gBAAE,KAAK,IAAQ,KAC9C,EACP,QAAQ,IAAI,CAAC,SAAS,IAAI,8CAAK,SAAS,EAAC,cAAc,gBAAE,QAAQ,IAAO,EACxE,SAAS,IAAI,CACZ,+CAAK,SAAS,EAAC,cAAc,iBAC3B,8CAAK,SAAS,EAAC,gBAAgB,gBAC7B,uBAAC,kCAA0B,KAAG,IAC1B,EACN,8CAAK,SAAS,EAAC,gBAAgB,gBAAE,SAAS,IAAO,KAC7C,CACP,KACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAe,SAAS,CAAC"}
|
|
@@ -1,2 +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
|
+
*/
|
|
1
21
|
export {};
|
|
2
22
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/_common/input/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/_common/input/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
|
package/lib/esm/_common/utils.js
CHANGED
|
@@ -75,7 +75,7 @@ export const useOnClickOutside = (ref, handler) => {
|
|
|
75
75
|
/**
|
|
76
76
|
* X - char long pseudo-random string
|
|
77
77
|
*/
|
|
78
|
-
export const randomId = (
|
|
78
|
+
export const randomId = (length) => Math.random()
|
|
79
79
|
.toString(36)
|
|
80
|
-
.slice(2,
|
|
80
|
+
.slice(2, length + 2);
|
|
81
81
|
//# sourceMappingURL=utils.js.map
|
|
@@ -38,7 +38,7 @@ import RadioAndCheckboxWrapper from '../_common/input/RadioAndCheckboxWrapper';
|
|
|
38
38
|
*/
|
|
39
39
|
const Checkbox = React.forwardRef((props, ref) => {
|
|
40
40
|
if (!props['aria-label'] && !props.label) {
|
|
41
|
-
console.warn('To be
|
|
41
|
+
console.warn('To be accessible the input component requires either `aria-label` or `label` prop: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI');
|
|
42
42
|
}
|
|
43
43
|
return (_jsx(RadioAndCheckboxWrapper, Object.assign({}, props, { ref: ref, type: "checkbox", role: "checkbox" })));
|
|
44
44
|
});
|
|
@@ -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,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,
|
|
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,uJAAuJ,CACxJ,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"}
|
|
@@ -99,33 +99,9 @@ const customStyles = ({ errorText, size, }) => {
|
|
|
99
99
|
placeholder: (provided) => (Object.assign(Object.assign({}, provided), { color: tokens.palette.light.neutral.text.weaker })),
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
|
-
const ExposedKeys = [
|
|
103
|
-
'onChange',
|
|
104
|
-
'isMulti',
|
|
105
|
-
'isClearable',
|
|
106
|
-
'formatOptionLabel',
|
|
107
|
-
'value',
|
|
108
|
-
'placeholder',
|
|
109
|
-
'options',
|
|
110
|
-
];
|
|
111
102
|
export const Dropdown = forwardRef(function Dropdown(props, ref) {
|
|
112
|
-
const { as, label, helpText, errorText, fluid = true, size = 'small', type = 'select',
|
|
103
|
+
const { as, label, helpText, errorText, fluid = true, size = 'small', type = 'select', 'aria-label': ariaLabel, selectProps = {} } = props, rest = __rest(props, ["as", "label", "helpText", "errorText", "fluid", "size", "type", 'aria-label', "selectProps"]);
|
|
113
104
|
const Component = as || 'div';
|
|
114
|
-
/**
|
|
115
|
-
* Merge selectProps with exposed react-select props
|
|
116
|
-
* Priority is given to selectProps
|
|
117
|
-
* Source: https://stackoverflow.com/a/32184094/3247715
|
|
118
|
-
*/
|
|
119
|
-
const MergedSelectProps = useMemo(() => ExposedKeys.reduce((a, e) => ((a[e] = selectProps[e] || rest[e]), a), selectProps), [rest, selectProps]);
|
|
120
|
-
/**
|
|
121
|
-
* Remove selectProps from rest
|
|
122
|
-
* to spread them in the root component
|
|
123
|
-
*/
|
|
124
|
-
const RestProps = useMemo(() => {
|
|
125
|
-
const cloned = Object.assign({}, rest);
|
|
126
|
-
ExposedKeys.forEach((key) => delete cloned[key]);
|
|
127
|
-
return cloned;
|
|
128
|
-
}, [rest]);
|
|
129
105
|
const ComponentOverrides = useMemo(() => overrideComponents({ errorText, size }), [errorText, size]);
|
|
130
106
|
const StyleOverrides = useMemo(() => customStyles({ errorText, size }), [errorText, size]);
|
|
131
107
|
const identifier = useMemo(() => {
|
|
@@ -139,20 +115,21 @@ export const Dropdown = forwardRef(function Dropdown(props, ref) {
|
|
|
139
115
|
}, [label, ariaLabel]);
|
|
140
116
|
let SelectElement;
|
|
141
117
|
switch (type) {
|
|
142
|
-
case 'async
|
|
143
|
-
SelectElement = (_jsx(AsyncSelect, Object.assign({ name: identifier, inputId: identifier },
|
|
118
|
+
case 'async': {
|
|
119
|
+
SelectElement = (_jsx(AsyncSelect, Object.assign({ name: identifier, inputId: identifier }, selectProps, { styles: Object.assign(Object.assign({}, StyleOverrides), selectProps.styles), components: Object.assign(Object.assign({}, ComponentOverrides), selectProps.components) })));
|
|
144
120
|
break;
|
|
145
121
|
}
|
|
146
122
|
case 'creatable':
|
|
147
|
-
SelectElement = (_jsx(Creatable, Object.assign({ name: identifier, inputId: identifier },
|
|
123
|
+
SelectElement = (_jsx(Creatable, Object.assign({ name: identifier, inputId: identifier }, selectProps, { styles: Object.assign(Object.assign({}, StyleOverrides), selectProps.styles), components: Object.assign(Object.assign({}, ComponentOverrides), selectProps.components) })));
|
|
148
124
|
break;
|
|
149
125
|
default:
|
|
150
|
-
SelectElement = (_jsx(Select, Object.assign({ name: identifier, inputId: identifier },
|
|
126
|
+
SelectElement = (_jsx(Select, Object.assign({ name: identifier, inputId: identifier }, selectProps, { styles: Object.assign(Object.assign({}, StyleOverrides), selectProps.styles), components: Object.assign(Object.assign({}, ComponentOverrides), selectProps.components) })));
|
|
151
127
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
128
|
+
const classNames = classnames('ndl-dropdown', props.className, {
|
|
129
|
+
'ndl-small': size === 'small',
|
|
130
|
+
'ndl-large': size === 'large',
|
|
131
|
+
'ndl-fluid': fluid,
|
|
132
|
+
});
|
|
133
|
+
return (_jsxs(Component, Object.assign({}, rest, { "aria-label": ariaLabel, ref: ref, className: classNames }, { children: [label && _jsx("label", Object.assign({ htmlFor: identifier }, { children: label })), SelectElement, helpText && !errorText && (_jsx("span", Object.assign({ className: "ndl-sub-text" }, { children: helpText }))), errorText && (_jsx("span", Object.assign({ className: "ndl-sub-text ndl-error-text" }, { children: errorText })))] })));
|
|
157
134
|
});
|
|
158
135
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../src/dropdown/Dropdown.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,2CAA2C;AAC3C,O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B,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;IAEH,OAAO,CACL,MAAC,SAAS,oBACJ,IAAI,kBACI,SAAS,EACrB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,iBAEpB,KAAK,IAAI,8BAAO,OAAO,EAAE,UAAU,gBAAG,KAAK,IAAS,EACpD,aAAa,EACb,QAAQ,IAAI,CAAC,SAAS,IAAI,CACzB,6BAAM,SAAS,EAAC,cAAc,gBAAE,QAAQ,IAAQ,CACjD,EACA,SAAS,IAAI,CACZ,6BAAM,SAAS,EAAC,6BAA6B,gBAAE,SAAS,IAAQ,CACjE,KACS,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overrides.js","sourceRoot":"","sources":["../../../src/dropdown/Overrides.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAEL,UAAU,GAKX,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAGlB,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAIvC,EACA,SAAS,EACT,IAAI,
|
|
1
|
+
{"version":3,"file":"Overrides.js","sourceRoot":"","sources":["../../../src/dropdown/Overrides.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAEL,UAAU,GAKX,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAGlB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AI,GACwD,EAAE,EAAE,CAChE,SAAS,SAAS,CAChB,KAA4D;IAE5D,OAAO,CACL,KAAC,UAAU,CAAC,gBAAgB,oBAAK,KAAK,cACpC,KAAC,gBAAgB,IACf,SAAS,EAAC,gCAAgC,EAC1C,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;aAC3C,GACD,IAC0B,CAC/B,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAI/B,EACA,SAAS,EACT,IAAI,GACwD,EAAE,EAAE,CAChE,SAAS,SAAS,CAAC,KAAuD;IACxE,OAAO,CACL,KAAC,UAAU,CAAC,WAAW,oBAAK,KAAK,cAC/B,4BAAK,SAAS,EAAC,sDAAsD,gBAClE,KAAK,CAAC,QAAQ,IACX,IACiB,CAC1B,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -30,18 +30,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
30
30
|
* You should have received a copy of the GNU General Public License
|
|
31
31
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
32
32
|
*/
|
|
33
|
-
import
|
|
33
|
+
import { forwardRef, useMemo } from 'react';
|
|
34
34
|
import classNames from 'classnames';
|
|
35
35
|
import { ExclamationCircleIconSolid } from '../icons';
|
|
36
36
|
import { needleWarningMessage } from '../_common/utils';
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* Helpers
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
/** Add any helper functions here. */
|
|
45
37
|
/**
|
|
46
38
|
*
|
|
47
39
|
*
|
|
@@ -49,7 +41,7 @@ import { needleWarningMessage } from '../_common/utils';
|
|
|
49
41
|
*
|
|
50
42
|
*
|
|
51
43
|
*/
|
|
52
|
-
const TextInput =
|
|
44
|
+
const TextInput = forwardRef(function TextInput(props, ref) {
|
|
53
45
|
const { label, fluid, errorText, helpText, leftIcon, rightIcon, type = 'text', containerSize = 'small', 'aria-label': ariaLabel } = props, customProps = __rest(props, ["label", "fluid", "errorText", "helpText", "leftIcon", "rightIcon", "type", "containerSize", 'aria-label']);
|
|
54
46
|
const containerWrappingClass = classNames(`ndl-form-item ndl-type-text`, customProps.className, {
|
|
55
47
|
'ndl-disabled': customProps.disabled,
|
|
@@ -71,7 +63,7 @@ const TextInput = React.forwardRef(function TextInput(props, ref) {
|
|
|
71
63
|
}
|
|
72
64
|
}, [label, ariaLabel]);
|
|
73
65
|
const customPropsClassNameStripped = Object.assign(Object.assign({}, customProps), { className: undefined });
|
|
74
|
-
return (_jsxs("div", Object.assign({ className: containerWrappingClass }, { children: [_jsxs("label", Object.assign({ className: labelWrappingClass }, { children: [_jsxs("div", Object.assign({ className: "ndl-input-wrapper" }, { children: [leftIcon && _jsx("div", Object.assign({ className: "ndl-icon ndl-left-icon" }, { children: leftIcon })), _jsx("input", Object.assign({}, customPropsClassNameStripped, { type: type, ref: ref, "aria-label": ariaLabel })), rightIcon && !errorText && (_jsx("div", Object.assign({ className: "ndl-right-icon" }, { children: rightIcon })))] })), _jsx("span", Object.assign({ className: "ndl-form-label-text" }, { children: label }))] })), helpText && !errorText && _jsx("div", Object.assign({ className: "ndl-form-msg" }, { children: helpText })), errorText && (_jsxs("div", Object.assign({ className: "ndl-form-msg" }, { children: [_jsx("div", Object.assign({ className: "ndl-error-icon" }, { children: _jsx(ExclamationCircleIconSolid, {}) })), _jsx("div", Object.assign({ className: "ndl-error-text" }, { children: errorText }))] })))] })));
|
|
66
|
+
return (_jsxs("div", Object.assign({ className: containerWrappingClass }, { children: [_jsxs("label", Object.assign({ className: labelWrappingClass }, { children: [_jsxs("div", Object.assign({ className: "ndl-input-wrapper" }, { children: [leftIcon && _jsx("div", Object.assign({ className: "ndl-icon ndl-left-icon" }, { children: leftIcon })), _jsx("input", Object.assign({}, customPropsClassNameStripped, { type: type, ref: ref, "aria-label": ariaLabel })), rightIcon && !errorText && (_jsx("div", Object.assign({ className: "ndl-icon ndl-right-icon" }, { children: rightIcon })))] })), _jsx("span", Object.assign({ className: "ndl-form-label-text" }, { children: label }))] })), helpText && !errorText && _jsx("div", Object.assign({ className: "ndl-form-msg" }, { children: helpText })), errorText && (_jsxs("div", Object.assign({ className: "ndl-form-msg" }, { children: [_jsx("div", Object.assign({ className: "ndl-error-icon" }, { children: _jsx(ExclamationCircleIconSolid, {}) })), _jsx("div", Object.assign({ className: "ndl-error-text" }, { children: errorText }))] })))] })));
|
|
75
67
|
});
|
|
76
68
|
export default TextInput;
|
|
77
69
|
//# sourceMappingURL=TextInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/text-input/TextInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/text-input/TextInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AA2BxD;;;;;;GAMG;AAEH,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,SAAS,CAC7C,KAA0B,EAC1B,GAAmC;IAEnC,MAAM,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,MAAM,EACb,aAAa,GAAG,OAAO,EACvB,YAAY,EAAE,SAAS,KAErB,KAAK,EADJ,WAAW,UACZ,KAAK,EAXH,2GAWL,C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,KAC9C,EACP,QAAQ,IAAI,CAAC,SAAS,IAAI,4BAAK,SAAS,EAAC,cAAc,gBAAE,QAAQ,IAAO,EACxE,SAAS,IAAI,CACZ,6BAAK,SAAS,EAAC,cAAc,iBAC3B,4BAAK,SAAS,EAAC,gBAAgB,gBAC7B,KAAC,0BAA0B,KAAG,IAC1B,EACN,4BAAK,SAAS,EAAC,gBAAgB,gBAAE,SAAS,IAAO,KAC7C,CACP,KACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -43,5 +43,5 @@ export interface RadioAndCheckboxProps extends Omit<CommonInputProps, 'label'> {
|
|
|
43
43
|
*
|
|
44
44
|
*/
|
|
45
45
|
export declare const customLabelAndNoAriaLabelWarningMessage = "aria label not detected when using a custom label, be sure to include an aria label for screen readers link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI";
|
|
46
|
-
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" | "
|
|
46
|
+
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" | "fluid" | "labelBefore"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
47
47
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
/**
|
|
3
2
|
*
|
|
4
3
|
* Copyright (c) "Neo4j"
|
|
@@ -19,7 +18,8 @@
|
|
|
19
18
|
* You should have received a copy of the GNU General Public License
|
|
20
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
20
|
*/
|
|
22
|
-
|
|
21
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
22
|
+
export interface CommonInputProps extends Omit<ComponentPropsWithoutRef<'input'>, 'nonce'> {
|
|
23
23
|
/** Sets disabled state */
|
|
24
24
|
disabled?: boolean;
|
|
25
25
|
/** Sets the label */
|
|
@@ -35,5 +35,5 @@ import { RadioAndCheckboxProps } from '../_common/input/RadioAndCheckboxWrapper'
|
|
|
35
35
|
*
|
|
36
36
|
*
|
|
37
37
|
*/
|
|
38
|
-
declare const Checkbox: 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" | "
|
|
38
|
+
declare const Checkbox: 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" | "fluid" | "labelBefore"> & React.RefAttributes<HTMLInputElement>>;
|
|
39
39
|
export default Checkbox;
|
|
@@ -60,7 +60,7 @@ interface StandardMenuItemProps extends Omit<ElementBase, 'title' | 'onClick' |
|
|
|
60
60
|
/** Show arrow icon to indicate nesting */
|
|
61
61
|
nested?: boolean;
|
|
62
62
|
onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent> | React.KeyboardEvent<HTMLElement>) => void;
|
|
63
|
-
/** Enforces no children on standard menu item.
|
|
63
|
+
/** Enforces no children on standard menu item. Overridden by nested menu item*/
|
|
64
64
|
children?: never;
|
|
65
65
|
}
|
|
66
66
|
export declare const MenuItem: React.ForwardRefExoticComponent<(Pick<StandardMenuItemProps, "size" | "className" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "list" | "children" | "role" | "as" | "selected" | "onChange" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "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" | "icon" | "description" | "nested"> | Pick<NestedMenuItemProps, "size" | "className" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "list" | "children" | "role" | "as" | "selected" | "onChange" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "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" | "icon" | "description" | "nested">) & React.RefAttributes<unknown>>;
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
import React from 'react';
|
|
22
22
|
/** Different types of select components */
|
|
23
23
|
import { GroupBase } from 'react-select';
|
|
24
|
-
import {
|
|
25
|
-
export declare const Dropdown: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>(props:
|
|
24
|
+
import { DropdownProps } from './types';
|
|
25
|
+
export declare const Dropdown: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>(props: DropdownProps<OptionType, IsMulti, GroupType> & React.RefAttributes<unknown>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClearIndicatorProps, DropdownIndicatorProps, GroupBase, MultiValueRemoveProps, PlaceholderProps } from 'react-select';
|
|
2
|
-
import {
|
|
3
|
-
export declare const DropdownIndicatorCurrying: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }:
|
|
4
|
-
export declare const CustomClearIndication: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }:
|
|
5
|
-
export declare const CustomMultiValueRemove: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }:
|
|
6
|
-
export declare const CustomPlaceholder: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }:
|
|
2
|
+
import { DropdownOverrideCustomProps } from './types';
|
|
3
|
+
export declare const DropdownIndicatorCurrying: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: DropdownOverrideCustomProps<OptionType, IsMulti, GroupType>) => (props: DropdownIndicatorProps<OptionType, IsMulti, GroupType>) => JSX.Element;
|
|
4
|
+
export declare const CustomClearIndication: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: DropdownOverrideCustomProps<OptionType, IsMulti, GroupType>) => (props: ClearIndicatorProps<OptionType, IsMulti, GroupType>) => JSX.Element;
|
|
5
|
+
export declare const CustomMultiValueRemove: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: DropdownOverrideCustomProps<OptionType, IsMulti, GroupType>) => (props: MultiValueRemoveProps<OptionType, IsMulti, GroupType>) => JSX.Element;
|
|
6
|
+
export declare const CustomPlaceholder: <OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>>({ errorText, size, }: DropdownOverrideCustomProps<OptionType, IsMulti, GroupType>) => (props: PlaceholderProps<OptionType, IsMulti, GroupType>) => JSX.Element;
|
|
@@ -22,17 +22,7 @@ import { GroupBase, Props } from 'react-select';
|
|
|
22
22
|
import { CreatableProps } from 'react-select/creatable';
|
|
23
23
|
import { AsyncProps } from 'react-select/async';
|
|
24
24
|
import { ElementBase } from '../helpers';
|
|
25
|
-
|
|
26
|
-
* We will provide a wrapper to the three distinct select components
|
|
27
|
-
* the library provides:
|
|
28
|
-
* 1. Select (the most simple component)
|
|
29
|
-
* 2. Creatable (for creatign new values in our options)
|
|
30
|
-
* 3. Async for fetching while typing, useful for cases that we avoid storing things
|
|
31
|
-
* in browser
|
|
32
|
-
*/
|
|
33
|
-
export declare type ComponentType<OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>> = SelectComponent<OptionType, IsMulti, GroupType>['type'] | CreatableComponent<OptionType, IsMulti, GroupType>['type'] | AsyncComponent<OptionType, IsMulti, GroupType>['type'];
|
|
34
|
-
declare type ComponentSelectProps<OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>> = SelectComponent<OptionType, IsMulti, GroupType>['selectProps'] | CreatableComponent<OptionType, IsMulti, GroupType>['selectProps'] | AsyncComponent<OptionType, IsMulti, GroupType>['selectProps'];
|
|
35
|
-
interface CommonProps extends Omit<ElementBase<HTMLDivElement>, 'label' | 'value'> {
|
|
25
|
+
interface DropdownCommonProps extends Omit<ElementBase<HTMLDivElement>, 'label' | 'value' | 'type'> {
|
|
36
26
|
/**
|
|
37
27
|
* Error message
|
|
38
28
|
*
|
|
@@ -50,19 +40,26 @@ interface CommonProps extends Omit<ElementBase<HTMLDivElement>, 'label' | 'value
|
|
|
50
40
|
/** Displays with fluid width */
|
|
51
41
|
fluid?: boolean;
|
|
52
42
|
}
|
|
53
|
-
declare type
|
|
54
|
-
selectProps: Props<OptionType, IsMulti, GroupType>;
|
|
43
|
+
declare type ReactSelectProps<OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>> = {
|
|
55
44
|
type: 'select';
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
selectProps: Props<OptionType, IsMulti, GroupType>;
|
|
46
|
+
} & DropdownCommonProps;
|
|
47
|
+
declare type ReactSelectAsyncProps<OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>> = {
|
|
48
|
+
type: 'async';
|
|
58
49
|
selectProps: AsyncProps<OptionType, IsMulti, GroupType>;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
declare type CreatableComponent<OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>> = {
|
|
62
|
-
selectProps: CreatableProps<OptionType, IsMulti, GroupType>;
|
|
50
|
+
} & DropdownCommonProps;
|
|
51
|
+
declare type ReactSelectCreatableProps<OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>> = {
|
|
63
52
|
type: 'creatable';
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
selectProps: CreatableProps<OptionType, IsMulti, GroupType>;
|
|
54
|
+
} & DropdownCommonProps;
|
|
55
|
+
/**
|
|
56
|
+
* We will provide a wrapper to the three distinct select components
|
|
57
|
+
* the library provides:
|
|
58
|
+
* 1. Select (the most simple component)
|
|
59
|
+
* 2. Creatable (for creating new values in our options)
|
|
60
|
+
* 3. Async for fetching while typing, useful for cases that we avoid storing things
|
|
61
|
+
* in browser
|
|
62
|
+
*/
|
|
63
|
+
export declare type DropdownProps<OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>> = ReactSelectProps<OptionType, IsMulti, GroupType> | ReactSelectCreatableProps<OptionType, IsMulti, GroupType> | ReactSelectAsyncProps<OptionType, IsMulti, GroupType>;
|
|
64
|
+
export declare type DropdownOverrideCustomProps<OptionType, IsMulti extends boolean = false, GroupType extends GroupBase<OptionType> = GroupBase<OptionType>> = Pick<DropdownProps<OptionType, IsMulti, GroupType>, 'size' | 'errorText'>;
|
|
68
65
|
export {};
|
|
@@ -35,5 +35,5 @@ import { RadioAndCheckboxProps } from '../_common/input/RadioAndCheckboxWrapper'
|
|
|
35
35
|
*
|
|
36
36
|
*
|
|
37
37
|
*/
|
|
38
|
-
declare const Radio: 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" | "
|
|
38
|
+
declare const Radio: 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" | "fluid" | "labelBefore"> & React.RefAttributes<HTMLInputElement>>;
|
|
39
39
|
export default Radio;
|
|
@@ -35,5 +35,5 @@ import { RadioAndCheckboxProps } from '../_common/input/RadioAndCheckboxWrapper'
|
|
|
35
35
|
*
|
|
36
36
|
*
|
|
37
37
|
*/
|
|
38
|
-
declare const Switch: 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" | "
|
|
38
|
+
declare const Switch: 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" | "fluid" | "labelBefore"> & React.RefAttributes<HTMLInputElement>>;
|
|
39
39
|
export default Switch;
|
|
@@ -18,8 +18,8 @@
|
|
|
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
|
-
import React from 'react';
|
|
22
21
|
import { CommonInputProps } from '../_common/input/types';
|
|
22
|
+
import type { ReactElement } from 'react';
|
|
23
23
|
export interface TextInputProperties extends CommonInputProps {
|
|
24
24
|
/** Label text */
|
|
25
25
|
label?: string;
|
|
@@ -28,22 +28,14 @@ export interface TextInputProperties extends CommonInputProps {
|
|
|
28
28
|
/** Error message */
|
|
29
29
|
errorText?: string;
|
|
30
30
|
/** Element to be shown as left icon */
|
|
31
|
-
leftIcon?:
|
|
31
|
+
leftIcon?: ReactElement;
|
|
32
32
|
/** Element to be shown as right icon */
|
|
33
|
-
rightIcon?:
|
|
33
|
+
rightIcon?: ReactElement;
|
|
34
34
|
/** Whether the input field is readonly */
|
|
35
35
|
readOnly?: boolean;
|
|
36
36
|
/** Size of the input field */
|
|
37
37
|
containerSize?: 'small' | 'large';
|
|
38
38
|
}
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* Helpers
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*/
|
|
46
|
-
/** Add any helper functions here. */
|
|
47
39
|
/**
|
|
48
40
|
*
|
|
49
41
|
*
|
|
@@ -51,5 +43,5 @@ export interface TextInputProperties extends CommonInputProps {
|
|
|
51
43
|
*
|
|
52
44
|
*
|
|
53
45
|
*/
|
|
54
|
-
declare const TextInput:
|
|
46
|
+
declare const TextInput: import("react").ForwardRefExoticComponent<Pick<TextInputProperties, "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" | "fluid" | "helpText" | "errorText" | "leftIcon" | "rightIcon" | "containerSize"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
55
47
|
export default TextInput;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.0-alpha-
|
|
4
|
+
"version": "1.0.0-alpha-e2de802",
|
|
5
5
|
"description": "React implementation of Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"neo4j",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@floating-ui/react-dom-interactions": "^0.12.0",
|
|
86
86
|
"@heroicons/react": "2.0.13",
|
|
87
|
-
"@neo4j-ndl/base": "1.0.0-alpha-
|
|
87
|
+
"@neo4j-ndl/base": "1.0.0-alpha-e2de802",
|
|
88
88
|
"@tanstack/react-table": "^8.5.22",
|
|
89
89
|
"classnames": "^2.3.1",
|
|
90
90
|
"detect-browser": "^5.3.0",
|