@luscii-healthtech/web-ui 2.3.1 → 2.5.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/Form/Form.d.ts +15 -5
- package/dist/components/Form/form.types.d.ts +6 -2
- package/dist/components/Icons/WarningIcon.d.ts +3 -0
- package/dist/components/Icons/types/IconProps.type.d.ts +1 -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 +7 -3
- package/dist/web-ui-tailwind.css +29 -0
- package/dist/web-ui.cjs.development.js +700 -482
- 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 +694 -481
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Form/Form.tsx +100 -68
- package/src/components/Form/form.types.ts +8 -1
- 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/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 +14 -6
- 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
package/src/index.tsx
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export {
|
|
2
|
-
default as
|
|
3
|
-
|
|
4
|
-
} from "./components/
|
|
2
|
+
default as Toaster,
|
|
3
|
+
TOASTER_TYPE_OPTIONS,
|
|
4
|
+
} from "./components/Toaster/Toaster";
|
|
5
|
+
export { toast } from "./components/Toaster/toast";
|
|
6
|
+
|
|
5
7
|
export { default as Avatar } from "./components/Avatar/Avatar";
|
|
6
8
|
export { default as Badge } from "./components/Badge/Badge";
|
|
7
9
|
export {
|
|
@@ -44,7 +46,7 @@ export {
|
|
|
44
46
|
} from "./components/List/List";
|
|
45
47
|
export {
|
|
46
48
|
CheckboxList,
|
|
47
|
-
|
|
49
|
+
CheckboxListProps,
|
|
48
50
|
} from "./components/CheckboxList/CheckboxList";
|
|
49
51
|
|
|
50
52
|
export { MultiSelect } from "./components/MultiSelect/MultiSelect";
|
|
@@ -67,6 +69,11 @@ export {
|
|
|
67
69
|
export { default as PreviewPhone } from "./components/PreviewPhone/PreviewPhone";
|
|
68
70
|
export { default as Radio } from "./components/Radio/Radio";
|
|
69
71
|
export { default as RadioGroup } from "./components/RadioGroup/RadioGroup";
|
|
72
|
+
export { RadioProps, RadioV2 } from "./components/Radio/RadioV2";
|
|
73
|
+
export {
|
|
74
|
+
RadioGroupProps,
|
|
75
|
+
RadioGroupV2,
|
|
76
|
+
} from "./components/RadioGroup/RadioGroupV2";
|
|
70
77
|
export { default as Section } from "./components/Section/Section";
|
|
71
78
|
export { default as SectionItemWithContent } from "./components/Section/SectionItemWithContent";
|
|
72
79
|
export {
|
|
@@ -74,6 +81,7 @@ export {
|
|
|
74
81
|
SectionItemProps,
|
|
75
82
|
} from "./components/Section/SectionItem";
|
|
76
83
|
//export { default as Select } from "./components/Select/Select";
|
|
84
|
+
export { SelectProps, Select } from "./components/Select/SelectV2";
|
|
77
85
|
export {
|
|
78
86
|
SettingsMenuButton,
|
|
79
87
|
SettingsMenuButtonProps,
|
|
@@ -113,8 +121,8 @@ export { default as Text } from "./components/Text/Text";
|
|
|
113
121
|
|
|
114
122
|
export { SearchInput, SearchInputProps } from "./components/Input/SearchInput";
|
|
115
123
|
|
|
116
|
-
export { Form } from "./components/Form/Form";
|
|
117
|
-
export { FormProps } from "./components/Form/form.types";
|
|
124
|
+
export { GenericForm, Form } from "./components/Form/Form";
|
|
125
|
+
export { GenericFormProps, FormProps } from "./components/Form/form.types";
|
|
118
126
|
|
|
119
127
|
export { IconProps } from "./components/Icons/types/IconProps.type";
|
|
120
128
|
export { AddIcon } from "./components/Icons/AddIcon";
|
|
@@ -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
|
-
|