@nice-digital/nds-input 4.0.16 → 4.0.18-alpha.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/es/Input.d.ts +15 -15
- package/es/Input.js +30 -30
- package/package.json +5 -5
package/es/Input.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./../scss/input.scss";
|
|
3
|
-
export interface InputProps {
|
|
4
|
-
[prop: string]: unknown;
|
|
5
|
-
className?: string;
|
|
6
|
-
defaultValue?: string;
|
|
7
|
-
error?: boolean;
|
|
8
|
-
errorMessage?: string;
|
|
9
|
-
hint?: string;
|
|
10
|
-
inputRef?: React.Ref<HTMLInputElement>;
|
|
11
|
-
label: string | null;
|
|
12
|
-
name: string;
|
|
13
|
-
type?: "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "range" | "password" | "search" | "tel" | "text" | "time" | "url" | "week";
|
|
14
|
-
}
|
|
15
|
-
export declare const Input: React.FC<InputProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./../scss/input.scss";
|
|
3
|
+
export interface InputProps {
|
|
4
|
+
[prop: string]: unknown;
|
|
5
|
+
className?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
hint?: string;
|
|
10
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
11
|
+
label: string | null;
|
|
12
|
+
name: string;
|
|
13
|
+
type?: "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "range" | "password" | "search" | "tel" | "text" | "time" | "url" | "week";
|
|
14
|
+
}
|
|
15
|
+
export declare const Input: React.FC<InputProps>;
|
package/es/Input.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Input = void 0;
|
|
18
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
-
require("./../scss/input.scss");
|
|
21
|
-
const Input = (props) => {
|
|
22
|
-
const { defaultValue, name, inputRef, error, errorMessage, label = "Label", hint, type = "text", className = "" } = props, rest = __rest(props, ["defaultValue", "name", "inputRef", "error", "errorMessage", "label", "hint", "type", "className"]);
|
|
23
|
-
const classNames = (0, classnames_1.default)({
|
|
24
|
-
input: true,
|
|
25
|
-
"input--error": error,
|
|
26
|
-
[`${className}`]: className
|
|
27
|
-
});
|
|
28
|
-
return ((0, jsx_runtime_1.jsxs)("div",
|
|
29
|
-
};
|
|
30
|
-
exports.Input = Input;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Input = void 0;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
+
require("./../scss/input.scss");
|
|
21
|
+
const Input = (props) => {
|
|
22
|
+
const { defaultValue, name, inputRef, error, errorMessage, label = "Label", hint, type = "text", className = "" } = props, rest = __rest(props, ["defaultValue", "name", "inputRef", "error", "errorMessage", "label", "hint", "type", "className"]);
|
|
23
|
+
const classNames = (0, classnames_1.default)({
|
|
24
|
+
input: true,
|
|
25
|
+
"input--error": error,
|
|
26
|
+
[`${className}`]: className
|
|
27
|
+
});
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: classNames, "data-component": "input", children: [label && ((0, jsx_runtime_1.jsx)("label", { className: "input__label", htmlFor: name, children: label })), hint && (0, jsx_runtime_1.jsx)("p", { className: "input__hint", children: hint }), error && (0, jsx_runtime_1.jsx)("p", { className: "input__error", children: errorMessage }), (0, jsx_runtime_1.jsx)("input", Object.assign({ ref: inputRef, name: name, className: "input__input", id: name, type: type, defaultValue: defaultValue }, rest))] }));
|
|
29
|
+
};
|
|
30
|
+
exports.Input = Input;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-digital/nds-input",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.18-alpha.0",
|
|
4
4
|
"description": "Input component for the NICE Design System",
|
|
5
5
|
"author": "Warren Keith <warren.keith@nice.org.uk>",
|
|
6
6
|
"homepage": "https://nice-digital.github.io/nice-design-system/",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"url": "https://github.com/nice-digital/nice-design-system/issues"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@nice-digital/nds-core": "^4.0.
|
|
34
|
+
"@nice-digital/nds-core": "^4.0.18-alpha.0",
|
|
35
35
|
"classnames": "^2.2.6"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"@testing-library/react": "^13.4.0",
|
|
40
40
|
"@testing-library/user-event": "^14.4.3",
|
|
41
41
|
"@types/jest": "^29.2.2",
|
|
42
|
-
"@types/node": "
|
|
43
|
-
"typescript": "^
|
|
42
|
+
"@types/node": "22.19.0",
|
|
43
|
+
"typescript": "^5.9.3"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": "^16 || ^17 || ^18",
|
|
47
47
|
"react-dom": "^16 || ^17 || ^18"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "d1bac6f89a952c97aeaf5d9d0ee9d99ee35a3ed3"
|
|
50
50
|
}
|