@luscii-healthtech/web-ui 2.5.2 → 2.7.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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.5.2",
2
+ "version": "2.7.1",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -0,0 +1,63 @@
1
+ import React from "react";
2
+ import classNames from "classnames";
3
+
4
+ import Button from "../Button/Button";
5
+ import { ButtonProps } from "../Button/Button.types";
6
+ import Text from "../Text/Text";
7
+ import { Title } from "../Title/Title";
8
+
9
+ export type BackgroundColor = "white" | "slate-50";
10
+
11
+ export interface CenteredHeroProps {
12
+ title: string;
13
+ text: string;
14
+ image: string;
15
+ buttons: ButtonProps[];
16
+ background?: BackgroundColor;
17
+ }
18
+
19
+ const CenteredHero = ({
20
+ title,
21
+ text,
22
+ image,
23
+ buttons,
24
+ background = "slate-50",
25
+ }: CenteredHeroProps): JSX.Element => {
26
+ return (
27
+ <div
28
+ className={classNames(
29
+ "p-6 flex flex-col items-center align-center w-full",
30
+ {
31
+ "bg-white": background === "white",
32
+ "bg-slate-50": background === "slate-50",
33
+ }
34
+ )}
35
+ >
36
+ {image && <img src={image} className="h-36 w-36 mb-4" />}
37
+ {title && <Title text={title} type={"base"} />}
38
+ {text && <Text text={text} />}
39
+
40
+ {buttons?.length > 0 && (
41
+ <div className="flex flex-row mt-4">
42
+ {buttons
43
+ .filter(
44
+ (button) => button.title && button.handleOnClick && button.type
45
+ )
46
+ .map((button) => (
47
+ <Button
48
+ className="mr-4 last:mr-0"
49
+ key={button.title}
50
+ role={button.role}
51
+ type={button.type}
52
+ title={button.title}
53
+ text={button.text}
54
+ onClick={button.handleOnClick}
55
+ />
56
+ ))}
57
+ </div>
58
+ )}
59
+ </div>
60
+ );
61
+ };
62
+
63
+ export default CenteredHero;
@@ -68,6 +68,7 @@ export const ListItem = ({
68
68
  {!loadIconError && icon && typeof icon === "string" && (
69
69
  <img
70
70
  src={icon}
71
+ data-chromatic="ignore"
71
72
  alt="list-item-icon"
72
73
  className="w-6 h-6 text-sm"
73
74
  onLoad={onListItemIconLoad}
@@ -33,6 +33,7 @@ export function LoadingIndicator({
33
33
  <div {...restProps} className={containerClassName}>
34
34
  <img
35
35
  src={asSpinner ? spinnerToRender : loadingImage}
36
+ data-chromatic="ignore"
36
37
  className={classNames("text-gray-600 fill-current stroke-current", {
37
38
  "h-4 w-4": asSpinner,
38
39
  "h-12 w-12": !asSpinner,
@@ -8,6 +8,7 @@ import "./RadioV2.css";
8
8
  export interface RadioProps
9
9
  extends React.InputHTMLAttributes<HTMLInputElement> {
10
10
  name: string;
11
+ // value field is used by react-hook-form as the value returned
11
12
  value: string | number;
12
13
  // text shown to the user to explain the option
13
14
  text?: string;
@@ -15,7 +16,6 @@ export interface RadioProps
15
16
  info?: string;
16
17
  isError?: boolean;
17
18
  innerRef?: React.Ref<HTMLInputElement>;
18
- // value field is used by react-hook-form as the value returned
19
19
  }
20
20
 
21
21
  function RadioInner({
@@ -1,14 +1,14 @@
1
1
  #application-toaster {
2
2
  position: fixed;
3
3
  left: 50%;
4
- transform: translate(-50%, 150%);
4
+ transform: translate(-50%, 200%);
5
5
  bottom: 48px;
6
6
 
7
7
  // https://easings.net/#easeInOutBack
8
8
  transition: transform 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
9
9
 
10
10
  &.shelved {
11
- transform: translate(-50%, 150%);
11
+ transform: translate(-50%, 200%);
12
12
  }
13
13
 
14
14
  &.expanded {
@@ -16,6 +16,8 @@
16
16
  }
17
17
 
18
18
  &.type-success {
19
+ @apply bg-green-50;
20
+
19
21
  [data-test-id="toaster-title"] {
20
22
  @apply text-green-700;
21
23
  }
@@ -34,6 +36,8 @@
34
36
  }
35
37
 
36
38
  &.type-failure {
39
+ @apply bg-red-50;
40
+
37
41
  [data-test-id="toaster-title"] {
38
42
  @apply text-red-700;
39
43
  }
@@ -44,7 +44,7 @@ const Toaster: React.VoidFunctionComponent<ToasterProps> = ({
44
44
  data-test-id={`toaster-panel-${type}`}
45
45
  className={classNames(
46
46
  "bg-white cursor-pointer",
47
- "rounded-md shadow-md",
47
+ "rounded-md shadow-lg",
48
48
  "min-h-13 max-h-19 w-104 transition-transform",
49
49
 
50
50
  {
@@ -1,50 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
- import classNames from "classnames";
4
-
5
- import Button, { BUTTON_ROLES } from "../Button/Button";
6
- import Text from "../Text/Text";
7
- import { Title } from "../Title/Title";
8
-
9
- CenteredHero.propTypes = {
10
- title: PropTypes.string,
11
- text: PropTypes.string,
12
- image: PropTypes.string,
13
- buttons: PropTypes.arrayOf(
14
- PropTypes.shape({
15
- title: PropTypes.string.isRequired,
16
- handleOnClick: PropTypes.func.isRequired,
17
- type: PropTypes.oneOf([BUTTON_ROLES.PRIMARY, BUTTON_ROLES.SECONDARY]).isRequired,
18
- })
19
- ),
20
- className: PropTypes.string,
21
- };
22
-
23
- function CenteredHero({ title, text, image, buttons, className }) {
24
- return (
25
- <div className={classNames(className, "p-6 my-6 flex flex-col items-center w-200 ml-auto mr-auto")}>
26
- {image && <img src={image} />}
27
- {title && <Title className="mt-8 mb-2" text={title} type={"base"} />}
28
- {text && <Text text={text} />}
29
-
30
- {buttons?.length > 0 && (
31
- <div className="flex flex-row mt-8">
32
- {buttons
33
- .filter((button) => button.title && button.handleOnClick && button.type)
34
- .map((button) => (
35
- <Button
36
- className="mr-4 last:mr-0"
37
- key={button.title}
38
- role={button.type}
39
- title={button.title}
40
- text={button.title}
41
- onClick={button.handleOnClick}
42
- />
43
- ))}
44
- </div>
45
- )}
46
- </div>
47
- );
48
- }
49
-
50
- export default CenteredHero;