@nice-digital/nds-alert 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/Alert.d.ts +10 -9
- package/es/Alert.js +33 -30
- package/package.json +5 -5
package/es/Alert.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "../scss/alert.scss";
|
|
3
|
-
interface AlertProps {
|
|
4
|
-
[prop: string]: unknown;
|
|
5
|
-
type?: "info" | "caution" | "error" | "success";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../scss/alert.scss";
|
|
3
|
+
interface AlertProps {
|
|
4
|
+
[prop: string]: unknown;
|
|
5
|
+
type?: "info" | "caution" | "error" | "success";
|
|
6
|
+
nonIntrusive?: boolean;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const Alert: React.FC<AlertProps>;
|
|
10
|
+
export {};
|
package/es/Alert.js
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
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.Alert = void 0;
|
|
18
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
-
require("../scss/alert.scss");
|
|
21
|
-
const allowedTypes = ["info", "caution", "error", "success"];
|
|
22
|
-
const Alert = (_a) => {
|
|
23
|
-
var { children, type = "info" } = _a, rest = __rest(_a, ["children", "type"]);
|
|
24
|
-
const classNames = (0, classnames_1.default)({
|
|
25
|
-
alert: true,
|
|
26
|
-
[`alert--${type}`]: true
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
}
|
|
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.Alert = void 0;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
+
require("../scss/alert.scss");
|
|
21
|
+
const allowedTypes = ["info", "caution", "error", "success"];
|
|
22
|
+
const Alert = (_a) => {
|
|
23
|
+
var { children, type = "info", nonIntrusive = false } = _a, rest = __rest(_a, ["children", "type", "nonIntrusive"]);
|
|
24
|
+
const classNames = (0, classnames_1.default)({
|
|
25
|
+
alert: true,
|
|
26
|
+
[`alert--${type}`]: true
|
|
27
|
+
});
|
|
28
|
+
const ariaBehaviour = nonIntrusive
|
|
29
|
+
? { "aria-live": "polite", "aria-atomic": true }
|
|
30
|
+
: { role: "alert" };
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classNames, "data-component": `alert${type ? `--${type}` : ""}` }, ariaBehaviour, rest, { children: children })));
|
|
32
|
+
};
|
|
33
|
+
exports.Alert = Alert;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-digital/nds-alert",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.18-alpha.0",
|
|
4
4
|
"description": "Alert component for the NICE Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"alert"
|
|
@@ -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
|
"peerDependencies": {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@testing-library/react": "^13.4.0",
|
|
44
44
|
"@testing-library/user-event": "^14.4.3",
|
|
45
45
|
"@types/jest": "^29.2.2",
|
|
46
|
-
"@types/node": "
|
|
47
|
-
"typescript": "^
|
|
46
|
+
"@types/node": "22.19.0",
|
|
47
|
+
"typescript": "^5.9.3"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "d1bac6f89a952c97aeaf5d9d0ee9d99ee35a3ed3"
|
|
50
50
|
}
|