allaw-ui 1.0.4 → 1.0.6
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/atoms/tags/OtherStatusTag.css +7 -0
- package/dist/components/atoms/tags/OtherStatusTag.d.ts +1 -0
- package/dist/components/atoms/tags/OtherStatusTag.js +7 -2
- package/dist/components/molecules/caseCard/CaseCard.css +5 -3
- package/dist/components/molecules/caseCard/CaseCard.d.ts +1 -0
- package/dist/components/molecules/caseCard/CaseCard.js +2 -2
- package/package.json +1 -1
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
text-align: center;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
.other-status-tag-label {
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
text-overflow: ellipsis;
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
17
24
|
.other-status-tag.readonly {
|
|
18
25
|
background: var(--tag-white, #eef5fc);
|
|
19
26
|
color: var(--Primary-Dark-grey, var(--dark-grey, #456073));
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./OtherStatusTag.css";
|
|
3
3
|
var OtherStatusTag = function (_a) {
|
|
4
|
-
var _b = _a.label, label = _b === void 0 ? "Tags" : _b, _c = _a.type, type = _c === void 0 ? "readonly" : _c, _d = _a.startIcon, startIcon = _d === void 0 ? false : _d, _e = _a.startIconName, startIconName = _e === void 0 ? "allaw-icon-pmr" : _e;
|
|
4
|
+
var _b = _a.label, label = _b === void 0 ? "Tags" : _b, _c = _a.type, type = _c === void 0 ? "readonly" : _c, _d = _a.startIcon, startIcon = _d === void 0 ? false : _d, _e = _a.startIconName, startIconName = _e === void 0 ? "allaw-icon-pmr" : _e, labelLimit = _a.labelLimit;
|
|
5
|
+
var truncateText = function (text, limit) {
|
|
6
|
+
if (!limit || text.length <= limit)
|
|
7
|
+
return text;
|
|
8
|
+
return "".concat(text.slice(0, limit), "...");
|
|
9
|
+
};
|
|
5
10
|
return (React.createElement("div", { className: "other-status-tag ".concat(type) },
|
|
6
11
|
type === "information" && startIcon && (React.createElement("span", { className: "icon ".concat(startIconName) })),
|
|
7
|
-
label,
|
|
12
|
+
React.createElement("span", { className: "other-status-tag-label", title: label }, truncateText(label, labelLimit)),
|
|
8
13
|
type === "editable" && React.createElement("span", { className: "icon allaw-icon-close" })));
|
|
9
14
|
};
|
|
10
15
|
export default OtherStatusTag;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
.case-card-wrapper {
|
|
4
4
|
display: flex;
|
|
5
|
-
width: 500px;
|
|
5
|
+
max-width: 500px;
|
|
6
|
+
min-width: 350px;
|
|
6
7
|
height: 150px;
|
|
7
8
|
padding: 10px 18px 14px 18px;
|
|
8
9
|
justify-content: space-between;
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
box-shadow: 0px 1px 9px 0px rgba(15, 133, 168, 0.08);
|
|
15
16
|
cursor: pointer;
|
|
16
17
|
transition: all 0.15s ease;
|
|
18
|
+
width: 100%;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
.case-card-wrapper:hover {
|
|
@@ -70,9 +72,8 @@
|
|
|
70
72
|
letter-spacing: 0.1px;
|
|
71
73
|
padding-top: 4px;
|
|
72
74
|
margin: 0;
|
|
73
|
-
width: 100%;
|
|
74
75
|
word-break: break-word;
|
|
75
|
-
width:
|
|
76
|
+
width: 100%;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
.case-card-next-appointment {
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
align-items: flex-end;
|
|
82
83
|
gap: 8px;
|
|
83
84
|
padding-top: 6px;
|
|
85
|
+
padding-left: 16px;
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
.case-card-next-appointment-label {
|
|
@@ -3,13 +3,13 @@ import "./CaseCard.css";
|
|
|
3
3
|
import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
|
|
4
4
|
import CardDate from "../../atoms/typography/CardDate";
|
|
5
5
|
var CaseCard = function (_a) {
|
|
6
|
-
var clientName = _a.clientName, title = _a.title, nextAppointment = _a.nextAppointment, categories = _a.categories, variant = _a.variant;
|
|
6
|
+
var clientName = _a.clientName, title = _a.title, nextAppointment = _a.nextAppointment, categories = _a.categories, variant = _a.variant, _b = _a.categoryLabelLimit, categoryLabelLimit = _b === void 0 ? 20 : _b;
|
|
7
7
|
return (React.createElement("div", { className: "case-card-wrapper case-card-".concat(variant) },
|
|
8
8
|
React.createElement("div", { className: "case-card-content" },
|
|
9
9
|
React.createElement("div", { className: "case-card-header" },
|
|
10
10
|
React.createElement("h2", { className: "case-card-title", title: title }, title),
|
|
11
11
|
React.createElement("span", { className: "case-card-client-name" }, clientName)),
|
|
12
|
-
React.createElement("div", { className: "case-card-categories" }, categories.map(function (category, index) { return (React.createElement(OtherStatusTag, { key: index, label: category, type: "readonly" })); }))),
|
|
12
|
+
React.createElement("div", { className: "case-card-categories" }, categories.map(function (category, index) { return (React.createElement(OtherStatusTag, { key: index, label: category, type: "readonly", labelLimit: categoryLabelLimit })); }))),
|
|
13
13
|
nextAppointment && variant !== "archived" && (React.createElement("div", { className: "case-card-next-appointment" },
|
|
14
14
|
React.createElement(CardDate, { date: nextAppointment.date, showYear: variant === "desktop" })))));
|
|
15
15
|
};
|