chop-logic-components 4.0.0 → 4.0.1
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/README.md +1 -0
- package/dist/components/molecules/alert/Alert.js +11 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
[](https://prettier.io)
|
|
14
14
|
[](https://keepachangelog.com/en/1.1.0/)
|
|
15
15
|
[](https://semver.org/spec/v2.0.0)
|
|
16
|
+
[](https://dashboard.stryker-mutator.io/reports/github.com/ChopLogic/chop-logic-components/main)
|
|
16
17
|
|
|
17
18
|
Welcome to **Chop Logic Components**, a React components library packed with a variety of **styled
|
|
18
19
|
components** and **custom hooks** that are easy to integrate into any React project.
|
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as I } from "react/jsx-runtime";
|
|
|
2
2
|
import { getClassName as v } from "../../../utils/get-class-name.js";
|
|
3
3
|
import { useRef as A } from "react";
|
|
4
4
|
import './Alert.css';/* empty css */
|
|
5
|
-
import { getAlertTitle as
|
|
5
|
+
import { getAlertTitle as B, getAlertIcon as C } from "./Alert.helpers.js";
|
|
6
6
|
import { AlertProgressBar as M } from "./AlertProgressBar.js";
|
|
7
7
|
import { useIsMounted as T } from "../../../hooks/use-is-mounted/use-is-mounted.js";
|
|
8
8
|
import { useIsHovered as b } from "../../../hooks/use-is-hovered/use-is-hovered.js";
|
|
@@ -15,24 +15,25 @@ import { ButtonView as j } from "../../../enums/button-view.js";
|
|
|
15
15
|
import { IconName as z } from "../../../enums/icon-name.js";
|
|
16
16
|
import S from "../../atoms/header/Header.js";
|
|
17
17
|
const W = ({
|
|
18
|
-
isOpened:
|
|
19
|
-
onClose:
|
|
18
|
+
isOpened: l,
|
|
19
|
+
onClose: i,
|
|
20
20
|
title: n,
|
|
21
21
|
message: m,
|
|
22
22
|
mode: t = x.Info,
|
|
23
23
|
icon: a,
|
|
24
|
-
autoClose:
|
|
24
|
+
autoClose: o = !1,
|
|
25
25
|
autoCloseDelay: c = 3e3,
|
|
26
26
|
...f
|
|
27
27
|
}) => {
|
|
28
|
-
const r = T(
|
|
28
|
+
const r = T(l), p = r && !l, s = A(null), d = b(s, r), u = !o, g = w({
|
|
29
29
|
isOpened: r,
|
|
30
30
|
isHovered: d,
|
|
31
|
-
onClose:
|
|
32
|
-
autoCloseDelay: c
|
|
31
|
+
onClose: i,
|
|
32
|
+
autoCloseDelay: c,
|
|
33
|
+
autoClose: o
|
|
33
34
|
});
|
|
34
35
|
if (!r) return null;
|
|
35
|
-
const _ =
|
|
36
|
+
const _ = B(t, n), h = C(t, a), N = v([
|
|
36
37
|
"cl-alert",
|
|
37
38
|
`cl-alert_${t.toLowerCase()}`,
|
|
38
39
|
{ "cl-alert_closing": p }
|
|
@@ -45,13 +46,13 @@ const W = ({
|
|
|
45
46
|
view: j.Icon,
|
|
46
47
|
iconSize: R.Medium,
|
|
47
48
|
label: "Close alert",
|
|
48
|
-
onClick:
|
|
49
|
+
onClick: i,
|
|
49
50
|
className: "cl-alert__button"
|
|
50
51
|
}
|
|
51
52
|
),
|
|
52
53
|
/* @__PURE__ */ e("header", { children: /* @__PURE__ */ e(S, { icon: h, as: "h3", className: "cl-alert__header", children: _ }) }),
|
|
53
54
|
/* @__PURE__ */ e("p", { className: "cl-alert__message", children: m }),
|
|
54
|
-
|
|
55
|
+
o && /* @__PURE__ */ e(M, { remainingPercentage: g })
|
|
55
56
|
] }) }) });
|
|
56
57
|
};
|
|
57
58
|
export {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "git+https://github.com/ChopLogic/chop-logic-components.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "4.0.
|
|
7
|
+
"version": "4.0.1",
|
|
8
8
|
"description": "Reusable React components and hooks for the Chop Logic project",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"module": "dist/index.es.js",
|