@luscii-healthtech/web-ui 2.3.1 → 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/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 +29 -0
- package/dist/web-ui.cjs.development.js +315 -122
- 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 +313 -121
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -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 +6 -4
- 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,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Toaster.scss";
|
|
3
|
+
export interface ToasterProps {
|
|
4
|
+
type: "success" | "failure";
|
|
5
|
+
message: string;
|
|
6
|
+
title: string;
|
|
7
|
+
isVisible?: boolean;
|
|
8
|
+
/** if you need to reposition the toaster for whatever reason you can use these props */
|
|
9
|
+
styleOverwrite?: Pick<React.CSSProperties, "top" | "bottom" | "left" | "right">;
|
|
10
|
+
}
|
|
11
|
+
export declare const TOASTER_TYPE_OPTIONS: {
|
|
12
|
+
readonly SUCCESS: "success";
|
|
13
|
+
readonly FAILURE: "failure";
|
|
14
|
+
};
|
|
15
|
+
export declare type ToasterType = typeof TOASTER_TYPE_OPTIONS[keyof typeof TOASTER_TYPE_OPTIONS];
|
|
16
|
+
declare const Toaster: React.VoidFunctionComponent<ToasterProps>;
|
|
17
|
+
export default Toaster;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
interface GetToasterElementsParams {
|
|
3
|
+
timeoutId: NodeJS.Timeout;
|
|
4
|
+
progressBarAnimationFrameHandler: number;
|
|
5
|
+
}
|
|
6
|
+
interface GetToasterElementsReturn {
|
|
7
|
+
toasterElementMessage: HTMLElement;
|
|
8
|
+
toasterProgressBar: HTMLElement;
|
|
9
|
+
toasterElementTitle: HTMLElement;
|
|
10
|
+
toasterElementSuccessIcon: HTMLElement;
|
|
11
|
+
toasterElementFailureIcon: HTMLElement;
|
|
12
|
+
toasterElementContainer: HTMLElement;
|
|
13
|
+
toasterCloseButton: HTMLElement;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param params.timeoutId - the timeoutId (that makes the toaster vanish), in case of a shortcut
|
|
18
|
+
* @param params.progressBarAnimationFrameHandler - animation frame id to be canceled in case of a shortcut
|
|
19
|
+
* @returns a collection of html elements to be manipulated by the animation
|
|
20
|
+
*/
|
|
21
|
+
export declare const getToasterElements: (params: GetToasterElementsParams) => GetToasterElementsReturn;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface AnimateProgressParams {
|
|
2
|
+
animationDuration: number;
|
|
3
|
+
progressBarElement: HTMLElement;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Reference: https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
|
|
7
|
+
* @param params.animationDuration - the amount of seconds the duration will take
|
|
8
|
+
* @param params.progressBarElement - the html element for the progress bar
|
|
9
|
+
* @returns the animation frame id
|
|
10
|
+
*/
|
|
11
|
+
export declare const animateProgress: (params: AnimateProgressParams) => number;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare type ToastParams = {
|
|
2
|
+
message: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
showIcon?: boolean;
|
|
5
|
+
type: "success" | "failure";
|
|
6
|
+
} | string;
|
|
7
|
+
export declare const toast: {
|
|
8
|
+
(params: ToastParams): void;
|
|
9
|
+
error(message: string): void;
|
|
10
|
+
info(message: string): void;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as Toaster, TOASTER_TYPE_OPTIONS, } from "./components/Toaster/Toaster";
|
|
2
|
+
export { toast } from "./components/Toaster/toast";
|
|
2
3
|
export { default as Avatar } from "./components/Avatar/Avatar";
|
|
3
4
|
export { default as Badge } from "./components/Badge/Badge";
|
|
4
5
|
export { BaseButtonProps as NonPrimaryButtonProps, ButtonWithPendingStateProps as PrimaryButtonProps, ButtonDefinition, } from "./components/ButtonV2/ButtonProps.type";
|
package/dist/web-ui-tailwind.css
CHANGED
|
@@ -969,6 +969,10 @@ video {
|
|
|
969
969
|
border-radius: 0.25rem;
|
|
970
970
|
}
|
|
971
971
|
|
|
972
|
+
.rounded-md {
|
|
973
|
+
border-radius: 0.375rem;
|
|
974
|
+
}
|
|
975
|
+
|
|
972
976
|
.rounded-lg {
|
|
973
977
|
border-radius: 0.5rem;
|
|
974
978
|
}
|
|
@@ -1001,6 +1005,11 @@ video {
|
|
|
1001
1005
|
border-bottom-left-radius: 0.25rem;
|
|
1002
1006
|
}
|
|
1003
1007
|
|
|
1008
|
+
.rounded-b-md {
|
|
1009
|
+
border-bottom-right-radius: 0.375rem;
|
|
1010
|
+
border-bottom-left-radius: 0.375rem;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1004
1013
|
.rounded-b-lg {
|
|
1005
1014
|
border-bottom-right-radius: 0.5rem;
|
|
1006
1015
|
border-bottom-left-radius: 0.5rem;
|
|
@@ -1449,6 +1458,10 @@ video {
|
|
|
1449
1458
|
margin-right: 0;
|
|
1450
1459
|
}
|
|
1451
1460
|
|
|
1461
|
+
.max-h-19 {
|
|
1462
|
+
max-height: 4.75rem;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1452
1465
|
.max-h-78 {
|
|
1453
1466
|
max-height: 19.5rem;
|
|
1454
1467
|
}
|
|
@@ -1461,6 +1474,10 @@ video {
|
|
|
1461
1474
|
max-width: 48rem;
|
|
1462
1475
|
}
|
|
1463
1476
|
|
|
1477
|
+
.min-h-13 {
|
|
1478
|
+
min-height: 3.25rem;
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1464
1481
|
.min-w-24 {
|
|
1465
1482
|
min-width: 1.5rem;
|
|
1466
1483
|
}
|
|
@@ -1693,6 +1710,10 @@ video {
|
|
|
1693
1710
|
right: 0;
|
|
1694
1711
|
}
|
|
1695
1712
|
|
|
1713
|
+
.bottom-0 {
|
|
1714
|
+
bottom: 0;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1696
1717
|
.left-0 {
|
|
1697
1718
|
left: 0;
|
|
1698
1719
|
}
|
|
@@ -2041,6 +2062,10 @@ video {
|
|
|
2041
2062
|
width: 20rem;
|
|
2042
2063
|
}
|
|
2043
2064
|
|
|
2065
|
+
.w-104 {
|
|
2066
|
+
width: 26rem;
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2044
2069
|
.w-200 {
|
|
2045
2070
|
width: 50rem;
|
|
2046
2071
|
}
|
|
@@ -2108,6 +2133,10 @@ video {
|
|
|
2108
2133
|
transition-property: opacity;
|
|
2109
2134
|
}
|
|
2110
2135
|
|
|
2136
|
+
.transition-transform {
|
|
2137
|
+
transition-property: transform;
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2111
2140
|
.ease-in {
|
|
2112
2141
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
2113
2142
|
}
|