allaw-ui 1.0.2 → 1.0.5
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/typography/CardDate.d.ts +8 -0
- package/dist/components/atoms/typography/CardDate.js +37 -0
- package/dist/components/atoms/typography/cardDate.css +38 -0
- package/dist/components/molecules/caseCard/CaseCard.css +32 -43
- package/dist/components/molecules/caseCard/CaseCard.js +4 -8
- package/package.json +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// CardDate.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
import "./cardDate.css";
|
|
4
|
+
var DAYS_FR = ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."];
|
|
5
|
+
var MONTHS_FR = [
|
|
6
|
+
"jan.",
|
|
7
|
+
"fév.",
|
|
8
|
+
"mar",
|
|
9
|
+
"avr.",
|
|
10
|
+
"mai",
|
|
11
|
+
"juin",
|
|
12
|
+
"juil.",
|
|
13
|
+
"aoû",
|
|
14
|
+
"sep.",
|
|
15
|
+
"oct.",
|
|
16
|
+
"nov.",
|
|
17
|
+
"déc.",
|
|
18
|
+
];
|
|
19
|
+
var CardDate = function (_a) {
|
|
20
|
+
var date = _a.date, _b = _a.showYear, showYear = _b === void 0 ? true : _b;
|
|
21
|
+
var parseDate = function (dateString) {
|
|
22
|
+
var d = new Date(dateString);
|
|
23
|
+
return {
|
|
24
|
+
weekDay: DAYS_FR[d.getDay()],
|
|
25
|
+
day: d.getDate(),
|
|
26
|
+
month: MONTHS_FR[d.getMonth()],
|
|
27
|
+
year: d.getFullYear(),
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
var _c = parseDate(date), weekDay = _c.weekDay, day = _c.day, month = _c.month, year = _c.year;
|
|
31
|
+
return (React.createElement("div", { className: "card-date" },
|
|
32
|
+
React.createElement("span", { className: "card-date-weekday" }, weekDay),
|
|
33
|
+
React.createElement("span", { className: "card-date-day" }, day),
|
|
34
|
+
React.createElement("span", { className: "card-date-month" }, month),
|
|
35
|
+
showYear && React.createElement("span", { className: "card-date-year" }, year)));
|
|
36
|
+
};
|
|
37
|
+
export default CardDate;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.card-date {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 2px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.card-date-weekday {
|
|
9
|
+
color: var(--mid-grey, #728ea7);
|
|
10
|
+
font-family: "Inter", sans-serif;
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
text-transform: lowercase;
|
|
13
|
+
line-height: 1;
|
|
14
|
+
padding-bottom: 5px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.card-date-day {
|
|
18
|
+
color: var(--dark-grey, #456073);
|
|
19
|
+
font-family: "Inter", sans-serif;
|
|
20
|
+
font-size: 36px;
|
|
21
|
+
font-weight: 700;
|
|
22
|
+
line-height: 0.7;
|
|
23
|
+
padding-bottom: 3px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.card-date-month {
|
|
27
|
+
color: var(--dark-grey, #456073);
|
|
28
|
+
font-family: "Inter", sans-serif;
|
|
29
|
+
font-size: 18px;
|
|
30
|
+
line-height: 0.9;
|
|
31
|
+
padding-bottom: 1px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.card-date-year {
|
|
35
|
+
color: var(--mid-grey, #728ea7);
|
|
36
|
+
font-family: "Inter", sans-serif;
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
}
|
|
@@ -2,21 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
.case-card-wrapper {
|
|
4
4
|
display: flex;
|
|
5
|
-
width:
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
max-width: 500px;
|
|
6
|
+
min-width: 350px;
|
|
7
|
+
height: 150px;
|
|
8
|
+
padding: 10px 18px 14px 18px;
|
|
8
9
|
justify-content: space-between;
|
|
9
10
|
align-items: flex-start;
|
|
10
11
|
flex-shrink: 0;
|
|
11
12
|
border-radius: 8px;
|
|
12
|
-
border:
|
|
13
|
+
border: 3px solid transparent;
|
|
13
14
|
background: var(--Primary-Blanc, #fff);
|
|
14
15
|
box-shadow: 0px 1px 9px 0px rgba(15, 133, 168, 0.08);
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
transition: all 0.15s ease;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.case-card-wrapper:hover {
|
|
21
|
+
border-color: var(--bleu-allaw, #25beeb);
|
|
22
|
+
box-shadow: 0px 4px 12px rgba(15, 133, 168, 0.12);
|
|
23
|
+
transform: scale(1.005);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.case-card-wrapper:active {
|
|
27
|
+
transform: scale(1.01);
|
|
28
|
+
background-color: var(--grey-light);
|
|
15
29
|
}
|
|
16
30
|
|
|
17
31
|
.case-card-wrapper.case-card-mobile,
|
|
18
32
|
.case-card-wrapper.case-card-archived {
|
|
19
|
-
height:
|
|
33
|
+
height: 150px;
|
|
20
34
|
}
|
|
21
35
|
|
|
22
36
|
.case-card-content {
|
|
@@ -31,7 +45,7 @@
|
|
|
31
45
|
display: flex;
|
|
32
46
|
flex-direction: column;
|
|
33
47
|
align-items: flex-start;
|
|
34
|
-
gap:
|
|
48
|
+
gap: 8px;
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
.case-card-client-name {
|
|
@@ -43,19 +57,22 @@
|
|
|
43
57
|
letter-spacing: 0.3px;
|
|
44
58
|
}
|
|
45
59
|
|
|
46
|
-
.case-card-title
|
|
47
|
-
.case-card-title-extended {
|
|
60
|
+
.case-card-title {
|
|
48
61
|
display: -webkit-box;
|
|
62
|
+
-webkit-line-clamp: 2;
|
|
49
63
|
-webkit-box-orient: vertical;
|
|
50
|
-
align-self: stretch;
|
|
51
64
|
overflow: hidden;
|
|
52
|
-
color: var(--Primary-Mid-black, var(--
|
|
65
|
+
color: var(--Primary-Mid-black, var(--dark-grey, #171e25));
|
|
53
66
|
text-overflow: ellipsis;
|
|
54
|
-
font-family:
|
|
55
|
-
font-size:
|
|
67
|
+
font-family: Inter, sans-serif;
|
|
68
|
+
font-size: 17px;
|
|
56
69
|
font-weight: 600;
|
|
57
|
-
line-height:
|
|
70
|
+
line-height: 1.2;
|
|
58
71
|
letter-spacing: 0.1px;
|
|
72
|
+
padding-top: 4px;
|
|
73
|
+
margin: 0;
|
|
74
|
+
word-break: break-word;
|
|
75
|
+
width: 100%;
|
|
59
76
|
}
|
|
60
77
|
|
|
61
78
|
.case-card-next-appointment {
|
|
@@ -63,12 +80,8 @@
|
|
|
63
80
|
flex-direction: column;
|
|
64
81
|
align-items: flex-end;
|
|
65
82
|
gap: 8px;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.case-card-mobile .case-card-next-appointment {
|
|
71
|
-
gap: 1px;
|
|
83
|
+
padding-top: 6px;
|
|
84
|
+
padding-left: 16px;
|
|
72
85
|
}
|
|
73
86
|
|
|
74
87
|
.case-card-next-appointment-label {
|
|
@@ -80,30 +93,6 @@
|
|
|
80
93
|
letter-spacing: 0.12px;
|
|
81
94
|
}
|
|
82
95
|
|
|
83
|
-
.case-card-next-appointment-date {
|
|
84
|
-
color: var(--Primary-Mid-black, var(--primary-black, #171e25));
|
|
85
|
-
font-family: Inter, sans-serif;
|
|
86
|
-
font-size: 20px;
|
|
87
|
-
font-weight: 700;
|
|
88
|
-
line-height: 9px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.case-card-next-appointment-time {
|
|
92
|
-
color: var(--Primary-Mid-black, var(--primary-black, #171e25));
|
|
93
|
-
font-family: Inter, sans-serif;
|
|
94
|
-
font-size: 14px;
|
|
95
|
-
font-weight: 700;
|
|
96
|
-
line-height: 16px;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.case-card-next-appointment-date-only {
|
|
100
|
-
color: var(--Primary-Dark-grey, var(--dark-grey, #456073));
|
|
101
|
-
font-family: Inter, sans-serif;
|
|
102
|
-
font-size: 14px;
|
|
103
|
-
font-weight: 600;
|
|
104
|
-
line-height: normal;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
96
|
.case-card-categories {
|
|
108
97
|
display: flex;
|
|
109
98
|
gap: 8px;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./CaseCard.css";
|
|
3
3
|
import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
|
|
4
|
+
import CardDate from "../../atoms/typography/CardDate";
|
|
4
5
|
var CaseCard = function (_a) {
|
|
5
6
|
var clientName = _a.clientName, title = _a.title, nextAppointment = _a.nextAppointment, categories = _a.categories, variant = _a.variant;
|
|
6
7
|
return (React.createElement("div", { className: "case-card-wrapper case-card-".concat(variant) },
|
|
7
8
|
React.createElement("div", { className: "case-card-content" },
|
|
8
9
|
React.createElement("div", { className: "case-card-header" },
|
|
9
|
-
React.createElement("
|
|
10
|
-
React.createElement("
|
|
11
|
-
? "case-card-title"
|
|
12
|
-
: "case-card-title-extended" }, title)),
|
|
10
|
+
React.createElement("h2", { className: "case-card-title", title: title }, title),
|
|
11
|
+
React.createElement("span", { className: "case-card-client-name" }, clientName)),
|
|
13
12
|
React.createElement("div", { className: "case-card-categories" }, categories.map(function (category, index) { return (React.createElement(OtherStatusTag, { key: index, label: category, type: "readonly" })); }))),
|
|
14
13
|
nextAppointment && variant !== "archived" && (React.createElement("div", { className: "case-card-next-appointment" },
|
|
15
|
-
React.createElement(
|
|
16
|
-
variant === "desktop" ? (React.createElement(React.Fragment, null,
|
|
17
|
-
React.createElement("span", { className: "case-card-next-appointment-date" }, nextAppointment.date),
|
|
18
|
-
React.createElement("span", { className: "case-card-next-appointment-time" }, nextAppointment.time))) : (React.createElement("span", { className: "case-card-next-appointment-date-only" }, nextAppointment.date))))));
|
|
14
|
+
React.createElement(CardDate, { date: nextAppointment.date, showYear: variant === "desktop" })))));
|
|
19
15
|
};
|
|
20
16
|
export default CaseCard;
|