allaw-ui 1.0.5 → 1.0.7
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 +8 -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,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
.case-card-wrapper {
|
|
4
4
|
display: flex;
|
|
5
|
-
|
|
5
|
+
width: 100%;
|
|
6
6
|
min-width: 350px;
|
|
7
|
+
max-width: 500px;
|
|
7
8
|
height: 150px;
|
|
8
9
|
padding: 10px 18px 14px 18px;
|
|
9
10
|
justify-content: space-between;
|
|
10
11
|
align-items: flex-start;
|
|
11
|
-
flex-shrink: 0;
|
|
12
12
|
border-radius: 8px;
|
|
13
13
|
border: 3px solid transparent;
|
|
14
14
|
background: var(--Primary-Blanc, #fff);
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
justify-content: space-between;
|
|
40
40
|
align-items: flex-start;
|
|
41
|
-
|
|
41
|
+
flex: 1;
|
|
42
|
+
min-width: 0;
|
|
43
|
+
overflow: hidden;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
.case-card-header {
|
|
@@ -82,6 +84,7 @@
|
|
|
82
84
|
gap: 8px;
|
|
83
85
|
padding-top: 6px;
|
|
84
86
|
padding-left: 16px;
|
|
87
|
+
flex-shrink: 0;
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
.case-card-next-appointment-label {
|
|
@@ -97,6 +100,8 @@
|
|
|
97
100
|
display: flex;
|
|
98
101
|
gap: 8px;
|
|
99
102
|
margin-top: 8px;
|
|
103
|
+
flex-wrap: wrap;
|
|
104
|
+
width: 100%;
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
.case-card-mobile .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
|
};
|