@luscii-healthtech/web-ui 2.60.1 → 2.61.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.
@@ -38,3 +38,12 @@ export interface ButtonDefinition<Props extends BaseButtonProps = BaseButtonProp
38
38
  buttonType: React.FunctionComponent<Props>;
39
39
  buttonProps: React.Attributes & Props;
40
40
  }
41
+ /**
42
+ * Interface for defining a button with mandatory key
43
+ */
44
+ export interface ButtonDefinitionWithKey<Props extends BaseButtonProps = BaseButtonProps> {
45
+ buttonType: React.FunctionComponent<Props>;
46
+ buttonProps: {
47
+ key: string | number;
48
+ } & Props;
49
+ }
@@ -1,8 +1,11 @@
1
1
  import { BaseButtonProps } from "../ButtonV2/ButtonProps.type";
2
2
  import { TimelineStepProps } from "./TimelineStep";
3
+ import { TimelineHeaderProps } from "./TimelineHeader";
3
4
  export interface TimelineProps {
5
+ headerProps?: TimelineHeaderProps;
4
6
  steps: TimelineStepProps[];
5
7
  loadMoreButtonProps?: BaseButtonProps;
8
+ dataTestId?: string;
6
9
  }
7
- export declare const Timeline: (props: TimelineProps) => JSX.Element;
10
+ export declare const Timeline: ({ headerProps, steps, loadMoreButtonProps, dataTestId, }: TimelineProps) => JSX.Element;
8
11
  export default Timeline;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { ButtonDefinitionWithKey, ButtonProps } from "../ButtonV2/ButtonProps.type";
3
+ import { TitleProps } from "../Title/Title";
4
+ export declare type TimelineHeaderProps = {
5
+ title?: string | TitleProps;
6
+ buttons?: ButtonDefinitionWithKey<ButtonProps>[];
7
+ withBorder?: boolean;
8
+ };
9
+ export declare const TimelineHeader: React.FC<TimelineHeaderProps>;
10
+ export default TimelineHeader;
@@ -1,8 +1,10 @@
1
1
  import React, { RefAttributes } from "react";
2
+ import { TextProps } from "../Text/Text";
2
3
  export interface TimelineStepProps extends RefAttributes<HTMLDivElement> {
3
4
  key: string | number;
4
5
  type?: "wide" | "base" | "withoutDot" | "emptyDot";
6
+ title?: string | TextProps;
5
7
  content: React.ReactNode;
6
8
  dataTestId?: string | number;
7
9
  }
8
- export declare const TimelineStep: React.ForwardRefExoticComponent<Pick<TimelineStepProps, "content" | "type" | "dataTestId" | "key"> & React.RefAttributes<HTMLDivElement>>;
10
+ export declare const TimelineStep: React.ForwardRefExoticComponent<Pick<TimelineStepProps, "content" | "type" | "dataTestId" | "title" | "key"> & React.RefAttributes<HTMLDivElement>>;
@@ -1318,6 +1318,10 @@ video {
1318
1318
  height: 3rem;
1319
1319
  }
1320
1320
 
1321
+ .h-13 {
1322
+ height: 3.25rem;
1323
+ }
1324
+
1321
1325
  .h-19 {
1322
1326
  height: 4.75rem;
1323
1327
  }
@@ -1532,10 +1536,6 @@ video {
1532
1536
  margin-left: 1.25rem;
1533
1537
  }
1534
1538
 
1535
- .mt-6 {
1536
- margin-top: 1.5rem;
1537
- }
1538
-
1539
1539
  .mb-6 {
1540
1540
  margin-bottom: 1.5rem;
1541
1541
  }
@@ -1572,10 +1572,6 @@ video {
1572
1572
  margin-bottom: 0.625rem;
1573
1573
  }
1574
1574
 
1575
- .-mt-px {
1576
- margin-top: -1px;
1577
- }
1578
-
1579
1575
  .-ml-px {
1580
1576
  margin-left: -1px;
1581
1577
  }
@@ -1799,6 +1795,10 @@ video {
1799
1795
  padding-top: 1rem;
1800
1796
  }
1801
1797
 
1798
+ .pb-4 {
1799
+ padding-bottom: 1rem;
1800
+ }
1801
+
1802
1802
  .pl-4 {
1803
1803
  padding-left: 1rem;
1804
1804
  }
@@ -1922,10 +1922,6 @@ video {
1922
1922
  left: 1rem;
1923
1923
  }
1924
1924
 
1925
- .top-6 {
1926
- top: 1.5rem;
1927
- }
1928
-
1929
1925
  .-top-1 {
1930
1926
  top: -0.25rem;
1931
1927
  }
@@ -4123,12 +4123,9 @@ var NotificationBanner = function NotificationBanner(props) {
4123
4123
  var color = props.color ? textColor[props.color] : "base";
4124
4124
  return /*#__PURE__*/React__default.createElement("div", {
4125
4125
  "data-test-id": "notification-banner",
4126
- className: classNames({
4127
- "w-full": stretch,
4128
- "inline-block": !stretch
4126
+ className: classNames(classes, {
4127
+ "inline-flex": !stretch
4129
4128
  })
4130
- }, /*#__PURE__*/React__default.createElement("div", {
4131
- className: classes
4132
4129
  }, props.icon && (typeof props.icon === "function" ? /*#__PURE__*/React__default.createElement(props.icon, {
4133
4130
  className: "w-6 h-6 mr-3"
4134
4131
  }) : /*#__PURE__*/React__default.createElement("img", {
@@ -4152,7 +4149,7 @@ var NotificationBanner = function NotificationBanner(props) {
4152
4149
  rel: "noopener",
4153
4150
  target: "_blank",
4154
4151
  onClick: props.linkProps.handleClick
4155
- })))));
4152
+ }))));
4156
4153
  };
4157
4154
  NotificationBanner.defaultProps = {
4158
4155
  color: "base",
@@ -7934,7 +7931,8 @@ var TimelineStep = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
7934
7931
  var content = _ref.content,
7935
7932
  _ref$type = _ref.type,
7936
7933
  type = _ref$type === void 0 ? "base" : _ref$type,
7937
- dataTestId = _ref.dataTestId;
7934
+ dataTestId = _ref.dataTestId,
7935
+ title = _ref.title;
7938
7936
  var isWideStep = type === "wide";
7939
7937
  var borderClassNames = "ml-4 pl-6 border-blue-800 border-l-2";
7940
7938
  var containerClassNames = classNames("relative", (_classNames = {}, _classNames[borderClassNames] = !isWideStep, _classNames["bg-white rounded-lg overflow-hidden"] = isWideStep, _classNames));
@@ -7946,21 +7944,69 @@ var TimelineStep = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
7946
7944
  ref: ref
7947
7945
  }, /*#__PURE__*/React__default.createElement("div", {
7948
7946
  className: "flex flex-col"
7949
- }, content), /*#__PURE__*/React__default.createElement("span", {
7950
- className: classNames("rounded-lg h-4 w-4 absolute top-6 -left-2 -ml-px -mt-px", {
7947
+ }, title && /*#__PURE__*/React__default.createElement(Text, _extends({
7948
+ type: "lg-strong",
7949
+ className: "border-b flex flex-row items-center h-13"
7950
+ }, typeof title === "object" ? title : {
7951
+ text: title
7952
+ })), content), /*#__PURE__*/React__default.createElement("div", {
7953
+ className: "absolute top-0 -left-2 -ml-px flex flex-row items-center h-13"
7954
+ }, /*#__PURE__*/React__default.createElement("span", {
7955
+ className: classNames("rounded-lg h-4 w-4 inline-block", {
7951
7956
  hidden: ["wide", "withoutDot"].includes(type),
7952
7957
  "bg-blue-800": "base" === type,
7953
7958
  "bg-white border-blue-800 border-4": "emptyDot" === type
7954
7959
  })
7955
- })));
7960
+ }))));
7956
7961
  });
7957
7962
 
7958
- var Timeline = function Timeline(props) {
7959
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", null, props.steps.map(function (step) {
7963
+ var TimelineHeader = function TimelineHeader(_ref) {
7964
+ var title = _ref.title,
7965
+ buttons = _ref.buttons,
7966
+ withBorder = _ref.withBorder;
7967
+ var hasButtons = buttons && buttons.length > 0;
7968
+ var className = classNames("flex flex-row items-center space-x-4 rounded-t px-4", {
7969
+ "py-4": !hasButtons,
7970
+ "py-2": hasButtons,
7971
+ "justify-between": title && hasButtons,
7972
+ "justify-start": title && !hasButtons,
7973
+ "justify-end": !title && hasButtons,
7974
+ "border-b": withBorder
7975
+ });
7976
+ return /*#__PURE__*/React__default.createElement("div", {
7977
+ "data-test-id": "timeline-header",
7978
+ className: className
7979
+ }, title && /*#__PURE__*/React__default.createElement(Title, _extends({
7980
+ type: "sm"
7981
+ }, typeof title === "object" ? title : {
7982
+ text: title
7983
+ })), hasButtons && /*#__PURE__*/React__default.createElement("div", {
7984
+ className: "flex flex-row space-x-4"
7985
+ }, buttons.map(function (_ref2) {
7986
+ var ButtonComponent = _ref2.buttonType,
7987
+ buttonProps = _ref2.buttonProps;
7988
+ return /*#__PURE__*/React__default.createElement(ButtonComponent, _extends({}, buttonProps));
7989
+ })));
7990
+ };
7991
+
7992
+ var Timeline = function Timeline(_ref) {
7993
+ var headerProps = _ref.headerProps,
7994
+ steps = _ref.steps,
7995
+ loadMoreButtonProps = _ref.loadMoreButtonProps,
7996
+ _ref$dataTestId = _ref.dataTestId,
7997
+ dataTestId = _ref$dataTestId === void 0 ? "timeline" : _ref$dataTestId;
7998
+ return /*#__PURE__*/React__default.createElement("div", {
7999
+ className: "bg-white rounded-xl",
8000
+ "data-test-id": dataTestId
8001
+ }, headerProps && /*#__PURE__*/React__default.createElement(TimelineHeader, _extends({}, headerProps)), /*#__PURE__*/React__default.createElement("div", {
8002
+ className: classNames("px-4 pb-4", {
8003
+ "pt-4": !headerProps
8004
+ })
8005
+ }, steps.map(function (step) {
7960
8006
  return /*#__PURE__*/React__default.createElement(TimelineStep, _extends({}, step));
7961
- })), props.loadMoreButtonProps && /*#__PURE__*/React__default.createElement("div", {
7962
- className: "mt-6 flex flex-row justify-center items-center"
7963
- }, /*#__PURE__*/React__default.createElement(SecondaryButton, _extends({}, props.loadMoreButtonProps))));
8007
+ })), loadMoreButtonProps && /*#__PURE__*/React__default.createElement("div", {
8008
+ className: "text-center border-t py-6"
8009
+ }, /*#__PURE__*/React__default.createElement(SecondaryButton, _extends({}, loadMoreButtonProps))));
7964
8010
  };
7965
8011
 
7966
8012
  var _excluded$t = ["titleProps", "title", "titleAccessory", "contentProps", "content", "defaultContent", "className", "buttons"];