@luscii-healthtech/web-ui 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Icons/WarningIcon.d.ts +3 -0
- package/dist/components/Icons/types/IconProps.type.d.ts +1 -0
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/List/List.types.d.ts +1 -0
- package/dist/components/List/ListItemSkeleton.d.ts +2 -0
- package/dist/components/List/ListSkeleton.d.ts +7 -0
- package/dist/components/Toaster/Toaster.d.ts +17 -0
- package/dist/components/Toaster/toast-elements-getter.d.ts +22 -0
- package/dist/components/Toaster/toast-progress-animator.d.ts +12 -0
- package/dist/components/Toaster/toast.d.ts +12 -0
- package/dist/index.d.ts +2 -1
- package/dist/web-ui-tailwind.css +45 -0
- package/dist/web-ui.cjs.development.js +411 -147
- package/dist/web-ui.cjs.development.js.map +1 -1
- package/dist/web-ui.cjs.production.min.js +1 -1
- package/dist/web-ui.cjs.production.min.js.map +1 -1
- package/dist/web-ui.esm.js +409 -146
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +5 -8
- package/src/components/Icons/CheckIcon.tsx +1 -0
- package/src/components/Icons/CrossIcon.tsx +1 -0
- package/src/components/Icons/WarningIcon.tsx +24 -0
- package/src/components/Icons/types/IconProps.type.ts +1 -0
- package/src/components/List/List.tsx +13 -9
- package/src/components/List/List.types.ts +1 -0
- package/src/components/List/ListItemSkeleton.tsx +26 -0
- package/src/components/List/ListSkeleton.scss +5 -0
- package/src/components/List/ListSkeleton.tsx +30 -0
- package/src/components/Toaster/Toaster.scss +53 -0
- package/src/components/Toaster/Toaster.tsx +100 -0
- package/src/components/Toaster/toast-elements-getter.ts +72 -0
- package/src/components/Toaster/toast-progress-animator.ts +53 -0
- package/src/components/Toaster/toast.ts +112 -0
- package/src/index.tsx +6 -4
- package/src/styles/_skeleton.scss +63 -0
- package/dist/components/Acknowledgement/Acknowledgement.d.ts +0 -22
- package/src/components/Acknowledgement/Acknowledgement.js +0 -61
- package/src/components/Acknowledgement/Acknowledgement.scss +0 -49
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@mixin skeleton() {
|
|
2
|
+
.skeleton-box {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
height: 1em;
|
|
5
|
+
position: relative;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
background-color: #cbd5e1; //slate 300
|
|
8
|
+
border-radius: 3px;
|
|
9
|
+
|
|
10
|
+
&::after {
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 0;
|
|
13
|
+
right: 0;
|
|
14
|
+
bottom: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
transform: translateX(-100%);
|
|
17
|
+
background-image: linear-gradient(
|
|
18
|
+
90deg,
|
|
19
|
+
rgba(#fff, 0) 0,
|
|
20
|
+
rgba(#fff, 0.2) 20%,
|
|
21
|
+
rgba(#fff, 0.5) 60%,
|
|
22
|
+
rgba(#fff, 0)
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
animation: shimmer 800ms infinite;
|
|
26
|
+
content: "";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.is-circle {
|
|
30
|
+
border-radius: 50%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.is-button {
|
|
34
|
+
background-color: #e2e8f0; //secondary button color
|
|
35
|
+
border-radius: 9999px;
|
|
36
|
+
|
|
37
|
+
&::after {
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 0;
|
|
40
|
+
right: 0;
|
|
41
|
+
bottom: 0;
|
|
42
|
+
left: 0;
|
|
43
|
+
transform: translateX(-100%);
|
|
44
|
+
background-image: linear-gradient(
|
|
45
|
+
90deg,
|
|
46
|
+
rgba(#ddd, 0) 0,
|
|
47
|
+
rgba(#ddd, 0.2) 20%,
|
|
48
|
+
rgba(#ddd, 0.5) 60%,
|
|
49
|
+
rgba(#ddd, 0)
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
animation: shimmer 800ms infinite;
|
|
53
|
+
content: "";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@keyframes shimmer {
|
|
58
|
+
100% {
|
|
59
|
+
transform: translateX(100%);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export namespace ACKNOWLEDGEMENT_TYPE_OPTIONS {
|
|
2
|
-
export const SUCCESS: string;
|
|
3
|
-
export const FAILURE: string;
|
|
4
|
-
}
|
|
5
|
-
export default Acknowledgement;
|
|
6
|
-
declare function Acknowledgement({ message, type, isVisible, hasIcon, className, }: {
|
|
7
|
-
message?: string | undefined;
|
|
8
|
-
type?: string | undefined;
|
|
9
|
-
isVisible?: boolean | undefined;
|
|
10
|
-
hasIcon?: boolean | undefined;
|
|
11
|
-
className?: string | undefined;
|
|
12
|
-
}): JSX.Element;
|
|
13
|
-
declare namespace Acknowledgement {
|
|
14
|
-
export const propTypes: {
|
|
15
|
-
message: PropTypes.Requireable<string>;
|
|
16
|
-
type: PropTypes.Requireable<string>;
|
|
17
|
-
hasIcon: PropTypes.Requireable<boolean>;
|
|
18
|
-
isVisible: PropTypes.Requireable<boolean>;
|
|
19
|
-
className: PropTypes.Requireable<string>;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
import PropTypes from "prop-types";
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import classNames from "classnames";
|
|
4
|
-
|
|
5
|
-
import { Text } from "../Text/Text";
|
|
6
|
-
import successIcon from "../../assets/success-icon.svg";
|
|
7
|
-
import failureIcon from "../../assets/error-icon.svg";
|
|
8
|
-
|
|
9
|
-
import "./Acknowledgement.scss";
|
|
10
|
-
|
|
11
|
-
export const ACKNOWLEDGEMENT_TYPE_OPTIONS = {
|
|
12
|
-
SUCCESS: "success",
|
|
13
|
-
FAILURE: "failure",
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
Acknowledgement.propTypes = {
|
|
17
|
-
message: PropTypes.string,
|
|
18
|
-
type: PropTypes.oneOf([ACKNOWLEDGEMENT_TYPE_OPTIONS.SUCCESS, ACKNOWLEDGEMENT_TYPE_OPTIONS.FAILURE]),
|
|
19
|
-
hasIcon: PropTypes.bool,
|
|
20
|
-
isVisible: PropTypes.bool,
|
|
21
|
-
className: PropTypes.string,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
function Acknowledgement({
|
|
25
|
-
message = "",
|
|
26
|
-
type = ACKNOWLEDGEMENT_TYPE_OPTIONS.SUCCESS,
|
|
27
|
-
isVisible = false,
|
|
28
|
-
hasIcon = false,
|
|
29
|
-
className = "",
|
|
30
|
-
}) {
|
|
31
|
-
const containerClassName = classNames("cweb-acknowledgement", className, {
|
|
32
|
-
"type-success": type === ACKNOWLEDGEMENT_TYPE_OPTIONS.SUCCESS,
|
|
33
|
-
"type-failure": type === ACKNOWLEDGEMENT_TYPE_OPTIONS.FAILURE,
|
|
34
|
-
"is-visible": isVisible,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
const iconContainerClasses = classNames("acknowledgement-icon-container", {
|
|
38
|
-
hidden: !hasIcon,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const successIconClasses = classNames("icon success-icon acknowledgement-icon", {
|
|
42
|
-
hidden: type !== ACKNOWLEDGEMENT_TYPE_OPTIONS.SUCCESS,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const failureIconClasses = classNames("icon failure-icon acknowledgement-icon", {
|
|
46
|
-
hidden: type !== ACKNOWLEDGEMENT_TYPE_OPTIONS.FAILURE,
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div id="application-acknowledgement" data-test-id={`acknowledgement-panel-${type}`} className={containerClassName}>
|
|
51
|
-
<div className={iconContainerClasses}>
|
|
52
|
-
<img src={successIcon} className={successIconClasses} alt="Success icon" />
|
|
53
|
-
<img src={failureIcon} className={failureIconClasses} alt="Failure icon" />
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<Text data-test-id="acknowledgement-message" text={message} />
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export default Acknowledgement;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
@import "../../styles/layout";
|
|
2
|
-
@import "../../styles/colors";
|
|
3
|
-
|
|
4
|
-
.cweb-acknowledgement {
|
|
5
|
-
@include horizontal-static-position(fixed, 10000);
|
|
6
|
-
@include flexbox-vertical(center, center);
|
|
7
|
-
|
|
8
|
-
$horizontal-margin: 6px;
|
|
9
|
-
$max-width: 360px - $horizontal-margin;
|
|
10
|
-
|
|
11
|
-
top: 0;
|
|
12
|
-
margin: 0 auto;
|
|
13
|
-
opacity: 0;
|
|
14
|
-
width: $max-width;
|
|
15
|
-
max-width: calc(100% - #{$horizontal-margin});
|
|
16
|
-
box-shadow: 0 0 20px 0 rgba(106, 191, 165, 0.2);
|
|
17
|
-
padding: 16px;
|
|
18
|
-
border-radius: 8px;
|
|
19
|
-
|
|
20
|
-
transform: translateY(-100%);
|
|
21
|
-
transition: transform ease-out 400ms, opacity 1ms linear 500ms;
|
|
22
|
-
|
|
23
|
-
> .acknowledgement-icon-container {
|
|
24
|
-
width: 48px;
|
|
25
|
-
height: 48px;
|
|
26
|
-
|
|
27
|
-
margin-bottom: 12px;
|
|
28
|
-
|
|
29
|
-
> .acknowledgement-icon {
|
|
30
|
-
width: 100%;
|
|
31
|
-
height: 100%;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&.type-success {
|
|
36
|
-
background: $color-positive-support;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&.type-failure {
|
|
40
|
-
background: $color-negative-support;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&.is-visible {
|
|
44
|
-
opacity: 1;
|
|
45
|
-
transform: translateY(32px);
|
|
46
|
-
transition: transform ease-in 150ms;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|