allaw-ui 1.0.36 → 1.0.38

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.
@@ -77,3 +77,30 @@
77
77
  justify-content: center;
78
78
  align-items: center;
79
79
  }
80
+
81
+ /* Styles pour le mode compact */
82
+ .other-status-tag.compact {
83
+ height: 22px;
84
+ padding: 6px 8px;
85
+ gap: 8px;
86
+ font-size: 12px;
87
+ min-height: 34px;
88
+ }
89
+
90
+ .other-status-tag.compact.editable {
91
+ height: 30px;
92
+ padding: 6px;
93
+ }
94
+
95
+ .other-status-tag.compact.information {
96
+ height: 22px;
97
+ padding: 6px;
98
+ font-size: 11px;
99
+ }
100
+
101
+ .other-status-tag.compact .icon {
102
+ width: 14px;
103
+ height: 14px;
104
+ padding: 2.833px;
105
+ font-size: 10px;
106
+ }
@@ -6,6 +6,7 @@ export interface OtherStatusTagProps {
6
6
  startIcon?: boolean;
7
7
  startIconName?: string;
8
8
  labelLimit?: number;
9
+ style?: "normal" | "compact";
9
10
  }
10
11
  declare const OtherStatusTag: React.FC<OtherStatusTagProps>;
11
12
  export default OtherStatusTag;
@@ -1,13 +1,13 @@
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, labelLimit = _a.labelLimit;
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, _f = _a.style, style = _f === void 0 ? "normal" : _f;
5
5
  var truncateText = function (text, limit) {
6
6
  if (!limit || text.length <= limit)
7
7
  return text;
8
8
  return "".concat(text.slice(0, limit), "...");
9
9
  };
10
- return (React.createElement("div", { className: "other-status-tag ".concat(type) },
10
+ return (React.createElement("div", { className: "other-status-tag ".concat(type, " ").concat(style) },
11
11
  type === "information" && startIcon && (React.createElement("span", { className: "icon ".concat(startIconName) })),
12
12
  React.createElement("span", { className: "other-status-tag-label", title: label }, truncateText(label, labelLimit)),
13
13
  type === "editable" && React.createElement("span", { className: "icon allaw-icon-close" })));
@@ -364,3 +364,42 @@
364
364
  align-items: center;
365
365
  gap: 8px;
366
366
  }
367
+
368
+ /* Styles compacts */
369
+ .appointment-slot.compact .appointment-time {
370
+ font-size: 14px;
371
+ }
372
+
373
+ .appointment-slot.compact .client-name {
374
+ font-size: 12px;
375
+ }
376
+
377
+ .appointment-slot.compact .appointment-content {
378
+ font-size: 14px;
379
+ }
380
+
381
+ .appointment-slot.compact .make-unavailable-text {
382
+ font-size: 12px;
383
+ }
384
+
385
+ .appointment-slot.compact .document-count,
386
+ .appointment-slot.compact .note-count {
387
+ font-size: 12px;
388
+ }
389
+
390
+ /* Styles compacts pour le mode summary */
391
+ .appointment-slot-summary.compact .summary-date {
392
+ font-size: 14px;
393
+ }
394
+
395
+ .appointment-slot-summary.compact .summary-time {
396
+ font-size: 14px;
397
+ }
398
+
399
+ .appointment-slot-summary.compact .appointment-content {
400
+ font-size: 14px;
401
+ }
402
+
403
+ .appointment-slot-summary.compact .client-name {
404
+ font-size: 12px;
405
+ }
@@ -20,6 +20,7 @@ export interface AppointmentSlotProps {
20
20
  };
21
21
  isEditable?: boolean;
22
22
  appointmentDetails?: string;
23
+ style?: "compact" | "big";
23
24
  }
24
25
  declare const AppointmentSlot: React.FC<AppointmentSlotProps>;
25
26
  export default AppointmentSlot;
@@ -5,8 +5,8 @@ import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
5
5
  import ActionCircleButton from "../../atoms/buttons/ActionCircleButton";
6
6
  import IconButton from "../../atoms/buttons/IconButton";
7
7
  var AppointmentSlot = function (_a) {
8
- var status = _a.status, startTime = _a.startTime, endTime = _a.endTime, date = _a.date, clientName = _a.clientName, appointmentContent = _a.appointmentContent, tags = _a.tags, noteCount = _a.noteCount, documentCount = _a.documentCount, actions = _a.actions;
9
- var _b = useState(false), isActive = _b[0], setIsActive = _b[1];
8
+ var status = _a.status, startTime = _a.startTime, endTime = _a.endTime, date = _a.date, clientName = _a.clientName, appointmentContent = _a.appointmentContent, tags = _a.tags, noteCount = _a.noteCount, documentCount = _a.documentCount, actions = _a.actions, _b = _a.style, style = _b === void 0 ? "compact" : _b;
9
+ var _c = useState(false), isActive = _c[0], setIsActive = _c[1];
10
10
  // Handlers
11
11
  var handleApprove = useCallback(function () {
12
12
  var _a;
@@ -39,7 +39,7 @@ var AppointmentSlot = function (_a) {
39
39
  // Render functions
40
40
  var renderHeader = function () { return (React.createElement("div", { className: "appointment-header" },
41
41
  React.createElement("span", { className: "appointment-time" }, "".concat(startTime, " - ").concat(endTime)),
42
- status !== "summary" && (React.createElement(AppointementStatusTag, { status: status })))); };
42
+ status !== "summary" && (React.createElement(AppointementStatusTag, { status: status, variant: style === "compact" ? "small" : "default" })))); };
43
43
  var renderFooter = function () {
44
44
  if (status === "available") {
45
45
  return renderAvailableFooter();
@@ -64,7 +64,7 @@ var AppointmentSlot = function (_a) {
64
64
  renderTags()),
65
65
  renderActionButtons())); };
66
66
  var renderTags = function () {
67
- return tags && (React.createElement("div", { className: "tags-container" }, tags.map(function (tag, index) { return (React.createElement(OtherStatusTag, { key: index, label: tag })); })));
67
+ return tags && (React.createElement("div", { className: "tags-container" }, tags.map(function (tag, index) { return (React.createElement(OtherStatusTag, { key: index, label: tag, style: style === "compact" ? "compact" : "normal" })); })));
68
68
  };
69
69
  var renderActionButtons = function () {
70
70
  switch (status) {
@@ -72,21 +72,22 @@ var AppointmentSlot = function (_a) {
72
72
  return (React.createElement("div", { className: "action-button-container" },
73
73
  React.createElement(ActionCircleButton, { status: "dual", onApprove: handleApprove, onReject: handleReject })));
74
74
  case "confirmed":
75
- return (React.createElement("div", { className: "document-actions" },
75
+ return documentCount && parseInt(documentCount) > 0 ? (React.createElement("div", { className: "document-actions" },
76
76
  React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-document", onClick: actions === null || actions === void 0 ? void 0 : actions.onViewDocument }),
77
- documentCount && (React.createElement("span", { className: "document-count" }, documentCount))));
77
+ React.createElement("span", { className: "document-count" }, documentCount))) : null;
78
78
  case "passed":
79
79
  return (React.createElement("div", { className: "document-actions" },
80
80
  React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-edit-2", onClick: actions === null || actions === void 0 ? void 0 : actions.onEdit }),
81
81
  noteCount && React.createElement("span", { className: "note-count" }, noteCount),
82
- React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-document", onClick: actions === null || actions === void 0 ? void 0 : actions.onViewDocument }),
83
- documentCount && (React.createElement("span", { className: "document-count" }, documentCount))));
82
+ documentCount && parseInt(documentCount) > 0 && (React.createElement(React.Fragment, null,
83
+ React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-document", onClick: actions === null || actions === void 0 ? void 0 : actions.onViewDocument }),
84
+ React.createElement("span", { className: "document-count" }, documentCount)))));
84
85
  default:
85
86
  return null;
86
87
  }
87
88
  };
88
89
  if (status === "summary") {
89
- return (React.createElement("div", { className: "appointment-slot-summary" },
90
+ return (React.createElement("div", { className: "appointment-slot-summary ".concat(style) },
90
91
  React.createElement("div", { className: "appointment-header" },
91
92
  React.createElement("div", { className: "date-time-container" },
92
93
  React.createElement("span", { className: "summary-date" }, date),
@@ -97,12 +98,11 @@ var AppointmentSlot = function (_a) {
97
98
  React.createElement("div", { className: "client-name" }, clientName),
98
99
  React.createElement("div", { className: "appointment-content" }, appointmentContent),
99
100
  renderTags()),
100
- React.createElement("div", { className: "document-actions-container" },
101
- React.createElement("div", { className: "document-actions" },
102
- React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-document", onClick: actions === null || actions === void 0 ? void 0 : actions.onViewDocument }),
103
- documentCount && (React.createElement("span", { className: "document-count" }, documentCount)))))));
101
+ React.createElement("div", { className: "document-actions-container" }, documentCount && parseInt(documentCount) > 0 && (React.createElement("div", { className: "document-actions" },
102
+ React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-document", onClick: actions === null || actions === void 0 ? void 0 : actions.onViewDocument }),
103
+ React.createElement("span", { className: "document-count" }, documentCount)))))));
104
104
  }
105
- return (React.createElement("div", { className: "appointment-slot ".concat(status, " ").concat(isActive ? "active" : ""), onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onClick: handleClick },
105
+ return (React.createElement("div", { className: "appointment-slot ".concat(status, " ").concat(isActive ? "active" : "", " ").concat(style), onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onClick: handleClick },
106
106
  renderHeader(),
107
107
  renderFooter()));
108
108
  };
@@ -60,9 +60,9 @@
60
60
  background-color: var(--grey-venom, #e6edf5);
61
61
  }
62
62
 
63
- .pagination-nav-button:hover:not(:disabled) {
63
+ /* .pagination-nav-button:hover:not(:disabled) {
64
64
  color: var(--primary-blue);
65
- }
65
+ } */
66
66
 
67
67
  .pagination-nav-button:disabled {
68
68
  opacity: 0.5;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",