@luscii-healthtech/web-ui 2.40.1 → 2.40.2
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/List/List.types.d.ts +2 -1
- package/dist/components/Text/Text.d.ts +33 -3
- package/dist/components/Title/Title.d.ts +4 -2
- package/dist/web-ui.cjs.development.js +52 -45
- 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 +52 -45
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { ButtonDefinition } from "../ButtonV2/ButtonProps.type";
|
|
3
3
|
import { IconProps } from "../Icons/types/IconProps.type";
|
|
4
4
|
import { PrimaryButtonProps } from "../../index";
|
|
5
|
+
import { TitleProps } from "../Title/Title";
|
|
5
6
|
export interface ListItemProps {
|
|
6
7
|
itemId: string | number;
|
|
7
8
|
title: string;
|
|
@@ -24,7 +25,7 @@ export interface ListItemProps {
|
|
|
24
25
|
}
|
|
25
26
|
export declare type OnAssetLoadErrorPayload = Pick<ListItemProps, "itemId" | "subtitle" | "title" | "icon">;
|
|
26
27
|
export declare type ListProps = {
|
|
27
|
-
title?: string;
|
|
28
|
+
title?: string | TitleProps;
|
|
28
29
|
headerButton?: ButtonDefinition<PrimaryButtonProps>;
|
|
29
30
|
headerTransparent?: boolean;
|
|
30
31
|
items: ListItemProps[];
|
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
import { RestPropped } from "../../types/general.types";
|
|
2
2
|
import "./Text.css";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
/**
|
|
4
|
+
* One might argue that we're duplicating strings in this file.
|
|
5
|
+
* That's how tailwind expects to detect used classes, so please do not make
|
|
6
|
+
* anything dynamic or try to string concat class names.
|
|
7
|
+
* https://v1.tailwindcss.com/docs/controlling-file-size
|
|
8
|
+
*/
|
|
9
|
+
declare const allowedTextStyles: {
|
|
10
|
+
sm: string;
|
|
11
|
+
"sm-strong": string;
|
|
12
|
+
base: string;
|
|
13
|
+
strong: string;
|
|
14
|
+
lg: string;
|
|
15
|
+
"lg-strong": string;
|
|
16
|
+
xl: string;
|
|
17
|
+
"xl-strong": string;
|
|
18
|
+
};
|
|
19
|
+
export declare const allowedColors: {
|
|
20
|
+
readonly base: "text-slate-800";
|
|
21
|
+
readonly "slate-500": "text-slate-500";
|
|
22
|
+
readonly "slate-200": "text-slate-200";
|
|
23
|
+
readonly red: "text-red-700";
|
|
24
|
+
readonly green: "text-green-700";
|
|
25
|
+
readonly amber: "text-yellow-700";
|
|
26
|
+
readonly white: "text-white";
|
|
27
|
+
readonly "blue-800": "text-blue-800";
|
|
28
|
+
};
|
|
29
|
+
declare const allowedHoverColors: {
|
|
30
|
+
readonly "blue-900": "hover:text-blue-900";
|
|
31
|
+
readonly white: "hover:text-white";
|
|
32
|
+
};
|
|
33
|
+
export declare type TextColor = keyof typeof allowedColors;
|
|
34
|
+
export declare type TextHoverColor = keyof typeof allowedHoverColors;
|
|
35
|
+
export declare type TextStyle = keyof typeof allowedTextStyles;
|
|
6
36
|
export interface TextProps extends RestPropped {
|
|
7
37
|
text: string;
|
|
8
38
|
type?: TextStyle;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import "./Title.scss";
|
|
2
|
+
import { TextColor } from "../Text/Text";
|
|
2
3
|
export declare type TitleStyle = "xs" | "sm" | "base" | "lg" | "xl" | "2xl";
|
|
3
|
-
export interface
|
|
4
|
+
export interface TitleProps {
|
|
4
5
|
text: string;
|
|
5
6
|
type?: TitleStyle;
|
|
7
|
+
color?: TextColor;
|
|
6
8
|
className?: string;
|
|
7
9
|
}
|
|
8
10
|
export declare const Title: {
|
|
9
|
-
(props:
|
|
11
|
+
(props: TitleProps): JSX.Element;
|
|
10
12
|
defaultProps: {
|
|
11
13
|
type: string;
|
|
12
14
|
};
|
|
@@ -571,32 +571,46 @@ function styleInject(css, ref) {
|
|
|
571
571
|
var css_248z = "/* https://stackoverflow.com/a/13924997 */\n\n.text-two-lines-max {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n /* number of lines to show */\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n";
|
|
572
572
|
styleInject(css_248z);
|
|
573
573
|
|
|
574
|
+
/**
|
|
575
|
+
* One might argue that we're duplicating strings in this file.
|
|
576
|
+
* That's how tailwind expects to detect used classes, so please do not make
|
|
577
|
+
* anything dynamic or try to string concat class names.
|
|
578
|
+
* https://v1.tailwindcss.com/docs/controlling-file-size
|
|
579
|
+
*/
|
|
580
|
+
|
|
581
|
+
var allowedTextStyles = {
|
|
582
|
+
sm: "text-xs font-medium",
|
|
583
|
+
"sm-strong": "text-xs font-semibold",
|
|
584
|
+
base: "text-sm",
|
|
585
|
+
strong: "text-sm font-semibold",
|
|
586
|
+
lg: "",
|
|
587
|
+
"lg-strong": "font-semibold",
|
|
588
|
+
xl: "text-lg",
|
|
589
|
+
"xl-strong": "font-semibold text-lg"
|
|
590
|
+
}; //Extend with other colors that we want to enable for text
|
|
591
|
+
|
|
592
|
+
var allowedColors = {
|
|
593
|
+
base: "text-slate-800",
|
|
594
|
+
"slate-500": "text-slate-500",
|
|
595
|
+
"slate-200": "text-slate-200",
|
|
596
|
+
red: "text-red-700",
|
|
597
|
+
green: "text-green-700",
|
|
598
|
+
amber: "text-yellow-700",
|
|
599
|
+
white: "text-white",
|
|
600
|
+
"blue-800": "text-blue-800"
|
|
601
|
+
};
|
|
602
|
+
var allowedHoverColors = {
|
|
603
|
+
"blue-900": "hover:text-blue-900",
|
|
604
|
+
white: "hover:text-white"
|
|
605
|
+
}; // What is a group hover? https://v1.tailwindcss.com/docs/pseudo-class-variants#group-hover
|
|
606
|
+
|
|
607
|
+
var allowedGroupHoverColors = {
|
|
608
|
+
"blue-900": "group-hover:text-blue-900",
|
|
609
|
+
white: "group-hover:text-white"
|
|
610
|
+
};
|
|
574
611
|
var Text = function Text(props) {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
* That's how tailwind expects to detect used classes, so please do not make
|
|
578
|
-
* anything dynamic or try to string concat class names.
|
|
579
|
-
* https://v1.tailwindcss.com/docs/controlling-file-size
|
|
580
|
-
*/
|
|
581
|
-
var allowedColors = {
|
|
582
|
-
base: "text-slate-800",
|
|
583
|
-
"slate-500": "text-slate-500",
|
|
584
|
-
"slate-200": "text-slate-200",
|
|
585
|
-
red: "text-red-700",
|
|
586
|
-
green: "text-green-700",
|
|
587
|
-
amber: "text-yellow-700",
|
|
588
|
-
white: "text-white",
|
|
589
|
-
"blue-800": "text-blue-800"
|
|
590
|
-
};
|
|
591
|
-
var allowedHoverColors = {
|
|
592
|
-
"blue-900": "hover:text-blue-900",
|
|
593
|
-
white: "hover:text-white"
|
|
594
|
-
}; // What is a group hover? https://v1.tailwindcss.com/docs/pseudo-class-variants#group-hover
|
|
595
|
-
|
|
596
|
-
var allowedGroupHoverColors = {
|
|
597
|
-
"blue-900": "group-hover:text-blue-900",
|
|
598
|
-
white: "group-hover:text-white"
|
|
599
|
-
};
|
|
612
|
+
var _props$type, _props$color;
|
|
613
|
+
|
|
600
614
|
var selectedHoverColor = props.hoverColor && !props.hoverInGroup && allowedHoverColors[props.hoverColor];
|
|
601
615
|
var selectedGroupHoverColor = props.hoverColor && props.hoverInGroup && allowedGroupHoverColors[props.hoverColor];
|
|
602
616
|
var containerProps = {
|
|
@@ -605,21 +619,11 @@ var Text = function Text(props) {
|
|
|
605
619
|
className: classNames( // apply different style classes
|
|
606
620
|
// for now we stick with font-size 16px on the body
|
|
607
621
|
// so I am adjusting our styles accordingly (one step down)
|
|
608
|
-
{
|
|
609
|
-
"text-xs font-medium": props.type === "sm",
|
|
610
|
-
"text-xs font-semibold": props.type === "sm-strong",
|
|
611
|
-
"text-sm": props.type === "base",
|
|
612
|
-
"text-sm font-semibold": props.type === "strong",
|
|
613
|
-
"": props.type === "lg",
|
|
614
|
-
"font-semibold": props.type === "lg-strong",
|
|
615
|
-
"text-lg": props.type === "xl",
|
|
616
|
-
"font-semibold text-lg": props.type === "xl-strong"
|
|
617
|
-
}, {
|
|
622
|
+
allowedTextStyles[(_props$type = props.type) != null ? _props$type : "base"], allowedColors[(_props$color = props.color) != null ? _props$color : "base"], selectedHoverColor, selectedGroupHoverColor, {
|
|
618
623
|
inline: props.inline,
|
|
619
624
|
// FIXME: this class doesn't do anything without a max-width
|
|
620
625
|
truncate: props.truncate,
|
|
621
|
-
"text-two-lines-max": props.clampLines
|
|
622
|
-
}, allowedColors[props.color || "base"], selectedHoverColor, selectedGroupHoverColor, {
|
|
626
|
+
"text-two-lines-max": props.clampLines,
|
|
623
627
|
"in-html-link": props.containsDangerousHtml
|
|
624
628
|
}, //can be used to overwrite other classes like the color
|
|
625
629
|
props.className)
|
|
@@ -964,11 +968,10 @@ var css_248z$2 = ".title {\n font-family: \"AvenirNextLTPro-Bold\", \"Roboto\",
|
|
|
964
968
|
styleInject(css_248z$2);
|
|
965
969
|
|
|
966
970
|
var Title = function Title(props) {
|
|
967
|
-
var _props$
|
|
971
|
+
var _props$color;
|
|
968
972
|
|
|
969
973
|
var containerClassName = classNames("title", //this is used to load the correct font from the css
|
|
970
|
-
"font-bold", {
|
|
971
|
-
"text-slate-800": !((_props$className = props.className) != null && _props$className.match(/\s(text-)/)),
|
|
974
|
+
"font-bold", allowedColors[(_props$color = props.color) != null ? _props$color : "base"], {
|
|
972
975
|
"text-base": props.type === "xs",
|
|
973
976
|
"text-xl": props.type === "sm",
|
|
974
977
|
"text-2xl": props.type === "base",
|
|
@@ -1307,6 +1310,11 @@ var List = function List(_ref) {
|
|
|
1307
1310
|
});
|
|
1308
1311
|
}
|
|
1309
1312
|
|
|
1313
|
+
var titleProps = title ? _extends({
|
|
1314
|
+
type: "xs"
|
|
1315
|
+
}, typeof title === "object" ? title : {
|
|
1316
|
+
text: title
|
|
1317
|
+
}) : null;
|
|
1310
1318
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
1311
1319
|
"data-test-id": dataTestId != null ? dataTestId : "list-component"
|
|
1312
1320
|
}, (title || headerButton) && /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -1320,10 +1328,7 @@ var List = function List(_ref) {
|
|
|
1320
1328
|
"justify-start": title && !headerButton,
|
|
1321
1329
|
"justify-end": !title && headerButton
|
|
1322
1330
|
})
|
|
1323
|
-
},
|
|
1324
|
-
type: "xs",
|
|
1325
|
-
text: title
|
|
1326
|
-
}), !!headerButton && /*#__PURE__*/React__default.createElement("div", {
|
|
1331
|
+
}, titleProps && /*#__PURE__*/React__default.createElement(Title, _extends({}, titleProps)), !!headerButton && /*#__PURE__*/React__default.createElement("div", {
|
|
1327
1332
|
className: "space-x-3"
|
|
1328
1333
|
}, /*#__PURE__*/React__default.createElement(headerButton.buttonType, headerButton.buttonProps))), /*#__PURE__*/React__default.createElement("ul", {
|
|
1329
1334
|
ref: listRef
|
|
@@ -6451,7 +6456,9 @@ var TimelineStep = function TimelineStep(_ref) {
|
|
|
6451
6456
|
className: classNames(borderClassNames, "h-4 first:h-0")
|
|
6452
6457
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
6453
6458
|
className: containerClassNames
|
|
6454
|
-
},
|
|
6459
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6460
|
+
className: "flex flex-col"
|
|
6461
|
+
}, content), /*#__PURE__*/React__default.createElement("span", {
|
|
6455
6462
|
className: classNames("rounded-lg h-4 w-4 absolute top-6 -left-2 -ml-px -mt-px", {
|
|
6456
6463
|
hidden: ["wide", "withoutDot"].includes(type),
|
|
6457
6464
|
"bg-blue-800": "base" === type,
|