@luscii-healthtech/web-ui 28.4.1 → 28.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/TimelineCard/TimelineCard.d.ts +11 -3
- package/dist/index.development.js +17 -11
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type FC } from "react";
|
|
1
|
+
import { type FC, type ReactNode } from "react";
|
|
2
2
|
import { IconKey } from "../Icons/types/IconProps.type";
|
|
3
3
|
type Props = {
|
|
4
4
|
title: string;
|
|
5
|
-
subtitle?:
|
|
5
|
+
subtitle?: ReactNode;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* @deprecated use leadingIcon instead.
|
|
8
8
|
*/
|
|
9
9
|
icon?: {
|
|
10
10
|
url: string;
|
|
@@ -13,6 +13,14 @@ type Props = {
|
|
|
13
13
|
iconKey: IconKey;
|
|
14
14
|
url?: never;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* The icon to render on the leading side of the card
|
|
18
|
+
*/
|
|
19
|
+
leadingIcon?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The icon to render on the trailing side of the card
|
|
22
|
+
*/
|
|
23
|
+
trailingIcon?: ReactNode;
|
|
16
24
|
/**
|
|
17
25
|
* Copy to display the status of the card
|
|
18
26
|
*/
|
|
@@ -6127,7 +6127,7 @@ const StatusIndicator = (props) => {
|
|
|
6127
6127
|
);
|
|
6128
6128
|
};
|
|
6129
6129
|
|
|
6130
|
-
const TimelineCard = ({ title, subtitle, icon, statusText, state = "default", disabled = false, onClick }) => {
|
|
6130
|
+
const TimelineCard = ({ title, subtitle, icon, leadingIcon, trailingIcon, statusText, state = "default", disabled = false, onClick }) => {
|
|
6131
6131
|
return React__namespace.default.createElement(
|
|
6132
6132
|
Stack,
|
|
6133
6133
|
{ axis: "x", width: "full", align: "center" },
|
|
@@ -6143,21 +6143,27 @@ const TimelineCard = ({ title, subtitle, icon, statusText, state = "default", di
|
|
|
6143
6143
|
}) },
|
|
6144
6144
|
React__namespace.default.createElement(
|
|
6145
6145
|
Stack,
|
|
6146
|
-
{ width: "full",
|
|
6147
|
-
statusText && React__namespace.default.createElement(Text, { variant: "sm", color: "slate-500" }, statusText),
|
|
6146
|
+
{ width: "full", p: "m", axis: "x", justify: "between", align: "center" },
|
|
6148
6147
|
React__namespace.default.createElement(
|
|
6149
6148
|
Stack,
|
|
6150
|
-
{ gap: "
|
|
6151
|
-
|
|
6152
|
-
(icon === null || icon === void 0 ? void 0 : icon.iconKey) && React__namespace.default.createElement(Icon, { className: "ui-flex-shrink-0", name: icon.iconKey }),
|
|
6149
|
+
{ gap: "xs" },
|
|
6150
|
+
statusText && React__namespace.default.createElement(Text, { variant: "sm", color: "slate-500" }, statusText),
|
|
6153
6151
|
React__namespace.default.createElement(
|
|
6154
6152
|
Stack,
|
|
6155
|
-
|
|
6156
|
-
(
|
|
6157
|
-
|
|
6158
|
-
|
|
6153
|
+
{ gap: "m", axis: "x", align: "center" },
|
|
6154
|
+
(icon === null || icon === void 0 ? void 0 : icon.url) && React__namespace.default.createElement("img", { className: "ui-flex-shrink-0", width: 24, height: 24, src: icon.url }),
|
|
6155
|
+
(icon === null || icon === void 0 ? void 0 : icon.iconKey) && React__namespace.default.createElement(Icon, { className: "ui-flex-shrink-0", name: icon.iconKey }),
|
|
6156
|
+
leadingIcon,
|
|
6157
|
+
React__namespace.default.createElement(
|
|
6158
|
+
Stack,
|
|
6159
|
+
null,
|
|
6160
|
+
(state === "bold" || state === "highlighted") && React__namespace.default.createElement(Title, { type: "xs" }, title),
|
|
6161
|
+
state === "default" && React__namespace.default.createElement(Text, { variant: "base", color: "slate-500" }, title),
|
|
6162
|
+
typeof subtitle === "string" ? React__namespace.default.createElement(Text, { variant: "sm", color: "slate-500" }, subtitle) : subtitle
|
|
6163
|
+
)
|
|
6159
6164
|
)
|
|
6160
|
-
)
|
|
6165
|
+
),
|
|
6166
|
+
trailingIcon
|
|
6161
6167
|
)
|
|
6162
6168
|
)
|
|
6163
6169
|
),
|